1.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: “city”
解释:改动了子组件中引用的父组件的变量,也就是props中的数据
解决方法:不要直接修改从父组件传过来的props数据,在data函数中重新定义一个变量,将props数据数据赋值在data变量上,后面修改data变量即可。如下:
props:["father"]
data(){
return{
father_1 = this.father
}
}