addAttr(data) {
data.forEach((item, index, arr) => {
if (item.id === userId) {
arr[index].disabled = true
this.it = item
if (item.children && item.children.length) {
this.addAttr(item.children)
}
} else {
if (item.children && item.children.length) {
this.addAttr(item.children)
}
}
})
this.terrdata = data
},
添加选中状态
const node = this.$refs.tree.getNode(this.it)
if (node.isLeaf) {
this.$refs.tree.setChecked(node, true)
}