当前位置:网站首页>El tree whether leaf node or not, the drop-down button is permanent

El tree whether leaf node or not, the drop-down button is permanent

2022-07-05 02:46:00 AzeShinja

After looking around, I didn't configure the permanent drop-down button , Then we will change his properties

My tree sub nodes are obtained by clicking a folder and requesting the interface , So we used updateKeyChildren This function

So let's encapsulate this function

    updateKeyChildren(id, data) {
    
      this.$refs.projectTree.updateKeyChildren(id, data);
      const node = this.$refs.projectTree.getNode(id);
      node.childNodes.forEach((item) => {
    
        item.expanded = false;
        item.isLeaf = false;
      });
    },

That's it , After testing getNode And traverse this childNodes It takes little time to use .
If there is a better way to leave a message in the comment area

原网站

版权声明
本文为[AzeShinja]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140858173048.html