vue.runtime.esm.js?2b0e:619 [Vue warn]: Avoid mutating a prop directly since the value will be overw
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 t
·
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: “activeName”
export default {
name : 'MoviesTop',
props: {
recentTags: Array,
activeName: String
},
methods: {
handleClick(tab, event) {
console.log(tab,event)
}
}
}
改为
export default {
name : 'MoviesTop',
props: {
recentTags: Array,
categroy: String
},
data() {
return {
activeName: this.categroy
}
},
methods: {
handleClick(tab, event) {
console.log(tab,event)
this.$emit("queryCoures", this.activeName);
}
}
}
问题解决
更多推荐
已为社区贡献5条内容
所有评论(0)