报错提示:
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: "typeVal"
解决方法:
将props接收过来的值先在data里存起来,在v-model里绑定data里的变量即可
props:{
typeVal:{
type:String
},
pageUrl:{
type:String
}
},
data(){
return{
//这里重新赋值是为了解决子组件修改父组件传来的props值报错问题
curTypeVal:this.typeVal,
curPageUrl:this.pageUrl,
}
},