前端工作总结111-不能改变父组件值

父组件通过props传值给子组件,如何避免子组件改变props的属性值报错问题

报错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: “status”

 

posted @ 2022-09-10 19:41  前端导师歌谣  阅读(22)  评论(0)    收藏  举报