其他分享
首页 > 其他分享> > tree使用

tree使用

作者:互联网

<el-tree ref="JigoutreeRef" :default-checked-keys="defJigouKeys" @node-expand="handleNodeClick" :props="defaultProps" 
:load="getOrgList" node-key="xzqbm" lazy show-checkbox></el-tree>

 

      defaultProps: {
        label: 'xzqmc',
        isLeaf: 'isLeaf'
      },
   getOrgList(node, resolve) {
      let self = this
      if (node.level == 0) {
        MenuAndUser.getJIgouNode('')
          .then(res => {
            let treeData = []
            res.data.forEach(e => {
              treeData.push(e)
            })
            resolve(treeData)
          })
          .catch(res => {
            resolve([])
          })
      } else {
        console.log(node)
        MenuAndUser.getJIgouNode(node.data.xzqbm)
          .then(res => {
            let mylist = []
            mylist = JSON.parse(JSON.stringify(res.data))
            resolve(mylist)
          })
          .catch(res => {
            resolve([])
          })
      }
    },

 

标签:node,resolve,treeData,res,tree,let,使用,data
来源: https://www.cnblogs.com/yadi001/p/15439149.html