Using the CheckBox component of iview in a modal box, the above error occurs in the console, the code is as follows:
// modal框内
<Checkbox v-model="formValidate.adress" :true-value="1" :false-value="0">是</Checkbox>
//js
data () {
return {
formValidate: {
name: '',
adress: 0,
},
}
}
Solution:
At first glance, there is nothing wrong with this, but here you need to pay attention to formValidate.adress
whether this is in other places 被赋值
or 被改变
, especially, it has been changed 其他数据类型
!
Of course, this is the case here. My adress was blanked when the modal box was closed, and changed to 0. Just null
reassign and change it to 0.