parent
							
								
									bbc079b703
								
							
						
					
					
						commit
						1075b49f6a
					
				| @ -0,0 +1,47 @@ | ||||
| /* | ||||
|  * @Description: 知识点 | ||||
|  * @Author: tangjiang | ||||
|  * @Github:  | ||||
|  * @Date: 2019-12-30 13:51:19 | ||||
|  * @LastEditors  : tangjiang | ||||
|  * @LastEditTime : 2019-12-30 14:20:50 | ||||
|  */ | ||||
| import './index.scss'; | ||||
| import React, { useState } from 'react'; | ||||
| import { Select } from 'antd'; | ||||
| 
 | ||||
| function KnowLedge (props) { | ||||
| 
 | ||||
|   const { | ||||
|     options = [], // 下拉选项
 | ||||
|     values = [], // 已选择的下拉项
 | ||||
|   } = props; | ||||
| 
 | ||||
|   // 显示的下拉项
 | ||||
|   const [selectOptions, setSelectOptions] = useState(options); | ||||
|   // 已选择的下拉项
 | ||||
|   const [selectValue, setSelectValue] = useState(values); | ||||
| 
 | ||||
|   // 渲染下拉选项
 | ||||
|   // 渲染下拉列表
 | ||||
|   const renderSelect = (options, values) => { | ||||
|     return ( | ||||
|       <Select | ||||
|         style={{ width: '100%' }} | ||||
|       > | ||||
| 
 | ||||
|       </Select> | ||||
|     ) | ||||
|   } | ||||
|    | ||||
|   return ( | ||||
|     <div className="knowledge-select-area"> | ||||
|       { renderSelect(selectOptions, selectValue) } | ||||
|       <div className="knowledge-select-result"> | ||||
|          | ||||
|       </div> | ||||
|     </div> | ||||
|   ); | ||||
| } | ||||
| 
 | ||||
| export default KnowLedge; | ||||
					Loading…
					
					
				
		Reference in new issue