<a-select
style=" 250px"
@change="get_department_id"
placeholder="请选择部门"
:value="select_option"
>
<a-select-option value="0">所有部门</a-select-option>
<a-select-option
:value="item.value"
v-for="item in All_Department"
:key="item.value"
>{{ item.label }}</a-select-option
>
</a-select>
export default {
data() {
return {
env: "test",
};
watch: {
env: function (newVal, oldVal) {
this.select_option = "0";
},
}
上面意思是 如果 env 发生变化,那么就会执行this.select_option = "0"; 从而实现下拉组件重置