报错 [Vue warn]: Avoid mutating a prop directly since the value will be overwritte

在vue2.0中子组件触发改变值的时候vue组件会报出例如:[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"vue

组件内直接修改props的值会报错 3d

解决方法: 在子组件使用该值时须要通过新变量(chooseType)从新传递,这样当这个值变动时,不会造selectType的更改

相关文章
相关标签/搜索