js处理dom循环随记
const obj = {
EXTERNAL_INDIVIDUAL: '外部个人',
EXTERNAL_CORP: '外部公司',
INTERNAL_INDIVIDUAL: '内部个人',
INTERNAL_CORP: '内部公司',
INTERNAL_INDIVIDUAL: '跨境个人',
OVERSEA_CORP: '跨境公司',
};
let options=[];
for (const key in obj) {
options.push(<Option key={key}>{obj[key]}</Option>);
}
element = (
<Select>
{options}
</Select>
)
render element
renderList(list) {
let children = '';
let html = (
<div>
{list.map((val) => {
return this.getChildRen(val)
})}
</div>);
return html;
}
网友评论