1.开发环境 vue
2.电脑系统 windows10专业版
3.在开发的过程中,咱们在应用element的Cascader 级联选择器会遇到回显的问题,上面我来分享一下解决办法。
4.废话不多说,间接上代码:

//vue代码<el-cascader     class="ipt-cascader"     v-model="AppListId" //要害代码    :options="dependentData.AppList"    :props="{ value:'value',label:'label',children:'datas'}"     @change="handleCascaderChange"    clearable></el-cascader>
// return代码AppListId:['',''],
//在对应的办法中增加如下this.AppListId[0]=this.positionData.cdcAppId;//数组的第一个值是第一层数据的idthis.AppListId[1]=this.positionData.tabId + '';数组的第二个值是第二层的id

4.成果如下:

//留神:::这是默认显示的,不是点击之后显示的

5.本期的分享到了这里就完结啦,心愿对你有所帮忙,让咱们一起致力走向巅峰。