vue报错Avoid mutating a prop directly since the value will be overwritten whenever

背景:

对vue的props里的属性赋值,页面上看赋值后props里的属性值被改变了,但是在控制台发现报错:Avoid mutating a prop directly since the value will be overwritten whenever

 

解决办法:

把props里的属性,放到data()方法里

posted @ 2022-06-26 14:22  jamstack  阅读(92)  评论(0编辑  收藏  举报