关于前端:eltree的全部展开收缩

47次阅读

共计 358 个字符,预计需要花费 1 分钟才能阅读完成。

利用于 vue
开展

Expand() {
      debugger;
      this.$nextTick(() => {
        debugger;
        for (var i = 0; i < this.$refs.tree.store._getAllNodes().length; i++) {
          debugger;
          this.$refs.tree.store._getAllNodes()[i].expanded = true;
        }
      });
    },

收起

shrink() {this.$nextTick(() => {
        debugger;
        for (var i = 0; i < this.$refs.tree.store._getAllNodes().length; i++) {
          debugger;
          this.$refs.tree.store._getAllNodes()[i].expanded = false;
        }
      });
    },

正文完
 0