dev_new_shixunsrepository
tangjiang 5 years ago
parent cb4fe6c284
commit e54a85f421

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-30 13:51:19
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-30 20:44:38
* @LastEditTime : 2019-12-31 09:06:44
*/
import './index.scss';
import React, { useState, useEffect } from 'react';
@ -46,16 +46,15 @@ function KnowLedge (props) {
}
return item.id !== value;
});
console.log(tempArr)
setSelectValue(tempArr);
setSelectOptions(_result);
}
// 渲染下拉结果
const renderResult = (arrs) => {
return arrs.map(item => (
<div className="knowledge-item" key={`item_$(item.id)`}>
<span className="knowledge-item-txt"></span>
return arrs.map((item) => (
<div className="knowledge-item" key={`item_${item.name}`}>
<span className="knowledge-item-txt">{item.name}</span>
</div>
));
}
@ -79,7 +78,11 @@ function KnowLedge (props) {
{ renderSelect(selectOptions) }
{/* 渲染下拉选择项 */}
<div className="knowledge-result">
{ renderResult(selectValue) }
{/* { renderResult(selectValue) } */}
{/* <div className="knowledge-item">1111</div> */}
<div className="knowledge-item">
<span className="knowledge-item-txt">JAVA</span>
</div>
</div>
</div>
);

Loading…
Cancel
Save