when I click on a node, I get the key and modify the label value of the corresponding database, then reassign data and use getNode (the selected id), value is still for changing the front end
editDepart(this.editFormData).then(res => {
this.SelectDepart();
console.log(111)
this.$nextTick(function () {
console.log(2222)
console.log(this.$refs.tree.getNode(2));
})
})
//
SelectDepart() {
findDepart().then(res => {
this.DepartTree = convertTree(res.data);
})
},
The
tree structure data has changed, but the value of getNode (modified id) is still the same!
setTimeout(function(){
console.log(that.$refs.tree.getNode(that.editFormData.id))
}, 3000);
you can get the latest label,
but! Here comes the problem!
setTimeout(function(){
console.log(that.$refs.tree.getNode(that.editFormData.id))
console.log(that.$refs.tree.getCurrentNode(that.editFormData.id))
}, 3000);
getCurrentNode is still not up to date!