对于父子组件之间的互相传值,报错如下: [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: "propTextTip" 大概
报错:Avoid mutating a prop directly since the value will be overwritten whenever the parent component........ 原因:所有的 prop 都使得其父子 prop 之间形成了一个单向下行绑定:父级 prop 的更新会向下流动到子组件中,但是反过来则不行.(父组件更新,子组件中的prop值也会更新,但子组件不能修改由父组件传递过来的值) 不能直接对父组件传来的值进行双向绑定,要先子组件里定义新的变量
vue不推荐直接在子组件中修改父组件传来的props的值,会报错 [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: "result&