element-ui级联选择组件list 注意要点涉及方法
export const loop_ = (data) => {
let office = data.map(item => {
// value必须字符串;children为空时,必须去掉其属性
item = {
label: item.label,
value: item.value + '',
children: loop_(item.children)
}
if (item.children.length === 0) {
let {
children,
...new_item
} = item;
return new_item
}
return item
})
return office
}
--by Affandi ⊙▽⊙
网友评论