tree组件折叠
// 关闭弹窗时,折叠组织树(耗时操作)
for (var i = 0; i < this.$refs.tree.store._getAllNodes().length; i++) {
this.$refs.tree.store._getAllNodes()[i].expanded = false;
}
tree设置节点半选解决方案
isLeaf(判断节点是否为叶子节点)
getNode(获取tree中对应的节点)
setChecked (设置tree中对应的节点为选中状态)
let res = [1,11,23,25,28,37];
res.map((i, n) => {
//根据i获取tree中的节点
var node = that.$refs.tree.getNode(i);
if (node.isLeaf) {
//设置某个节点的勾选状态
that.$refs.tree.setChecked(node, true);
}
});