0
点赞
收藏
分享

微信扫一扫

element tree只选择父,不选择孙

fbd4ffd0717b 2022-05-27 阅读 55





      updateChange(e, node, data) {
const isChecked = e.path[0].checked
const arr = []
this.$set(data, 'isChecked', isChecked)
arr.push(data.label)
node.childNodes.map(res => {
this.$set(res.data, 'isChecked', isChecked)
arr.push(res.data.label)
})
arr.map(item => {
if (isChecked) {
this.checkList.push(item)
} else {
const i = this.checkList.indexOf(item)
i > -1 && this.checkList.splice(i, 1)
}
})
this.checkList = [... new Set(this.checkList)]
console.log(this.checkList)
}

 


举报

相关推荐

0 条评论