Vue.js Multiple definitions of a property not allowed in strict mode

本小妞迷上赌 提交于 2019-12-04 09:36:56

You can't use v-model and :checked at the same time. When you added v-model="selectedGender", you provided it a way to determine the checked status based on the value of selectedGender. That caused it to create this code:

checked: t._q(t.selectedGender, "MALE")

When you also added :check="selectedGender === 'FEMALE'" you caused it to add this other way to set the checked status:

checked: "FEMALE" === t.selectedGender,

You can't have both. Just remove the :checked= to fix this.

To build on @Charles answer, this is true of other duplicate properties as well. For example you can't have :value="myProperty" and value="true" declared as it will create similar code mentioned in Charles answer.

Simply removing the duplicate properties fixes these kinds of issues.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!