problem description
iview"s official website only introduces binding load-data attributes. Clicking the arrow symbol with the mouse will asynchronously load the data and expand the node. What should I do if I want to trigger this process directly with the code?
the environmental background of the problems and what methods you have tried
it is not possible to call loadData directly, because you cannot get the second parameter, callback,callback, which contains the context of the tree component and must be passed in by the component itself
related codes
loadData: function (item, callback) {
this.$get(this.url + item.id, function (res) {
if(res.data && res.data.length > 0){
callback(res.data);
}else{
item.loading = false;
}
})
}