zoukankan      html  css  js  c++  java
  • el-tree组件过来吧默认打开全部子节点

    //搜索到节点必须打开此节点所有子节点,因为默认是不会打开子节点的,所以手动设置打开的最高层级。本次我设置了最大四个层级
          filterNode(value,data,node) {
            if(!value){
              return true;
            }
            let level = node.level;
            let _array = [];//这里使用数组存储 只是为了存储值。
            this.getReturnNode(node,_array,value);
            let result = false;
            _array.forEach((item)=>{
              result = result || item;
            });
            return result;
          },
          getReturnNode(node,_array,value){
            let isPass = node.data &&  node.data.label && node.data.label.indexOf(value) !== -1;
            isPass?_array.push(isPass):'';
            this.index++;
            if(!isPass && node.level!=1 && node.parent){
              this.getReturnNode(node.parent,_array,value);
            }
          },
    

      

  • 相关阅读:
    spark shuffle 机制
    hive explain 源码分析
    前端jQurey
    js-dom操作
    前端JS
    前端CSS
    Redis和MongoDB区别
    MySQL数据库备份
    MySQL索引
    python连接mysql服务端
  • 原文地址:https://www.cnblogs.com/hy96/p/12786780.html
Copyright © 2011-2022 走看看