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

vue2.0 练习中报错问题处理vue

报错(数据是能够正确显示在页面中的):code

[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"

报错说明 component

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

解决方法sed

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

相关文章
相关标签/搜索