< el-tree
: data= "tagTree"
show-checkbox
node-key= "id"
ref= "tree"
: default-expanded-keys= "tags [index] .tags"
: default-checked-keys= "tags [index] .selected
: props=" defaultProps ">
< / el-tree >
defaultProps: {
children: "children",
label:" label",
disabled: function (data, node) {
if(node.store.getCheckedKeys(true).length >= 5) {
return node.store.getCheckedKeys(true).indexOf(data.id) < 0
}
}
},
you can now select five and the rest of the disabled will be true,. When I change the data of the tree control, how can I select only five (if the data has not changed, three have been selected, and two can be selected after the change)