在清空二级下拉框时,直接使用this.formData.xxx = '' 会出现清空失败的问题。
使用this.$set(this.formData, 'xxx', '')解决
<el-form-item label="所属地市" prop="blongId1"> <el-select v-model="bmixForm.blongId1" placeholder="请选择所属地市" style="width: 300px" @change="getAreaList2"> <el-option v-for="(item, index) in blongId1List" :key="index" :label="item.NAME" :value="item.ID"></el-option> </el-select> </el-form-item> <el-form-item label="所属分区" prop="blongId2"> <el-select v-model="bmixForm.blongId2" placeholder="请选择所属分区" style="width: 300px"> <el-option v-for="(item, index) in bmixFormBlongId2List" :key="index" :label="item.NAME" :value="item.ID"></el-option> </el-select> </el-form-item>
getAreaList2(){ this.$set(this.bmixForm, 'blongId2', '') this.getAreaListByCity2(this.bmixForm.blongId1); }
标签:二级,VUE,formData,bmixForm,清空,下拉框 From: https://www.cnblogs.com/Neonuu/p/18356234