問題:
<a-radio @change="chooseOther" v-model="tempReadio">其他</a-radio>
computed: {
tempReadio() {
if (this.reasonValue == 7) {
return true;
} else {
return false;
}
},
因為我們平時綁定的都是data裏面的數據 ,當這個value值是冬天的時候, 嚴格模式下 此時就會報錯
解決方法: 手動添加set 就好了
computed: {
tempReadio: {
get() {
if (this.reasonValue == 7) {
return true;
} else {
return false;
}
},
set(val) {},
},
},
vue 官網也有給到解釋,關於v-model綁定了vuex 或者 computed的時候,需要自己設置get和set即可
https://vuex.vuejs.org/zh/gui...