咏竹莉
where there is a will,there is a way
  transform(list) {
      if (Array.isArray(list) && list.length !== 0) {
        list = list.map((v) => {
          v.label = v.name; // 返回label
          // v.key = v.value
          if (!this.transform(v.children)) {
            v.isLeaf = true;
          }
          return v;
        });
        return list;
      } else {
        return false;
      }
    }

 

posted on 2021-09-13 16:56  咏竹莉  阅读(133)  评论(0编辑  收藏  举报