[Vue warn]: Avoid mutating a prop directly since the value will be overwritten
Posted on 2019-11-26 15:50 勤勤恳恳大猿人 阅读(1759) 评论(0) 编辑 收藏 举报控制台报错:
vue.runtime.esm.js?2b0e:619 [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: "is_show_record"
原因:
传入的prop,被子组件内部又做了一次修改,然后抛的异常
解决方案:
提交事件,通过父组件修改,父组件重新渲染时,子组件会被覆盖