react ant design casecader 联动递归显示

joinJobs(jobs) {
    let options = []
    jobs.map((item, key) => {
      options.push({
        // value: item.id,
        value: item.name,
        label: item.name,
        isLeaf: item.subjobs ? false : true,
      })
      if(item.subjobs) {
        options[key].children = this.joinJobs(item.subjobs)
      }
    })
    return options
  }

换成你的数组即可

猜你喜欢

转载自blog.csdn.net/junjiahuang/article/details/108072537
今日推荐