vue修改props传递的参数时报错:[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: "cur"。
[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: “cur”-Qui-Note

解决办法:

将参数赋值给一个data数据,动态修改这个数据就可以了!
  

data() {
    return {
      active: this.cur || 0,
    }
  },
  props: {
    cur:0,
  },
  methods: {
     clickTap(index) {
        this.active = index
      },
  }

这样就解决这个vue报参数不能修改的问题了!最近发现vue用着越来越顺手了,可能遇到的坑愈来愈多了,解决的问题也不少了,都是积累的!继续加油。