1.修改需要显示的标签与值

<el-cascader :show-all-levels="false" v-model="cascaderData" :options="mainItemsOne" :props="{children:'twocountytown',label:'name',value:'code',checkStrictly:true}" @change="handleChange" ref="cascader">
</el-cascader>

2.获取选中列的其它值

let codetype = this.$refs.cascader.getCheckedNodes()[0].data.codetype

3.递归处理,设置某一属性不可选中

treeFix (tree) {
  tree.forEach(item=>{
    if(item.codetype=='3'){
      item.disabled = true
    }
    if(item.twocountytown){
      this.treeFix(item.twocountytown)
    }
   })
 }
作者 铁血 汉子 2021年6月12日
2024/04/25/05:31:53pm 2021/6/12/15:33:48
0 751