vue报错:Error in callback for watcher “options“: “TypeError: Cannot read propertie ‘level‘ of null
vue报错:Error in callback for watcher "options": "TypeError: Cannot read propertie 'level' of null
·
<el-form-item label='查询方式:'>
<el-select v-model='formData.way' placeholder='' @change='changeWay'>
<el-option v-for='(item, selectIndex) in wayOptions' :label='item.label' :value='item.value' :key='selectIndex'></el-option>
</el-select>
</el-form-item>
watch: {
wayOptions(newVal) {
this.selectIndex++
},
deep: true
}
},
包含级联cascader的options、select的option
原因:在cascader、select中选择了一条数据,再更换类型,没有这条数据了就会报错,watch监听重新渲染标注一下key就好了
更多推荐
已为社区贡献1条内容
所有评论(0)