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 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);
    }
  }
}

问题解决

你可能感兴趣的:(问题解决,vue)