optimize select style

dev_static
tangjiang 5 years ago
parent 32b6f8b552
commit 21a57b274d

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-30 13:51:19 * @Date: 2019-12-30 13:51:19
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-03 09:32:24 * @LastEditTime : 2020-01-03 18:56:36
*/ */
import './index.scss'; import './index.scss';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
@ -49,7 +49,8 @@ function KnowLedge (props) {
} }
// 过滤下拉列表项 // 过滤下拉列表项
const handleSelectChange = (value) => { const handleSelectChange = (value) => {
value = +value.join(''); // value = +value.join('');
value = +value;
const tempArr = [...selectValue]; const tempArr = [...selectValue];
const _result = selectOptions.filter(item => { const _result = selectOptions.filter(item => {
if (item.id === value && tempArr.findIndex(t => t.id === value) === -1) { if (item.id === value && tempArr.findIndex(t => t.id === value) === -1) {
@ -103,7 +104,7 @@ function KnowLedge (props) {
return ( return (
<Select <Select
value={value} value={value}
mode="tags" // mode="tags"
placeholder="请选择" placeholder="请选择"
style={{ width: '100%' }} style={{ width: '100%' }}
onChange={handleSelectChange} onChange={handleSelectChange}

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-20 10:35:40 * @Date: 2019-11-20 10:35:40
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-03 11:28:26 * @LastEditTime : 2020-01-03 19:02:17
*/ */
import './index.scss'; import './index.scss';
// import 'katex/dist/katex.css'; // import 'katex/dist/katex.css';

Loading…
Cancel
Save