最近在学习Vue,昨天的一个小项目中我遇到了一个需求:首页点击注册,注册为弹框组件,决定它显隐的是父组件data里的registerVisible值,我尝试在注册这个组件里点击提交按钮后,改变registerVisible的值为false,发现报错:1[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" (found in component )
阅读全文…