发布于 3年前

vue2.0 报错问题处理(数据绑定错误)

vue2.0 报错(数据是可以正确显示在页面中的):

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "selectType"

报错说明

主要问题出在props的数据上,props绑定的数据是从父级传过来的,提示中 selectType 是自身组件中的数据,不需要从父级获取

解决方法

将 selectType 绑定到 data() 上就对了

相关文章

©2020 edoou.com   京ICP备16001874号-3