Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-

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: “currentPage”

避免直接改变一个道具,因为当父组件重新呈现时,该值将被覆盖。相反,使用基于道具值的数据或计算属性。道具突变:“currentPage”

currentPage是从父级传过来用props接收的参数值,在子级中修改了这个值

需要在data中进行赋值,如果不同data这样进行赋值,那就会出现上面的报错

Vue.component('my-componeent',{
	template:`

你可能感兴趣的:(vue,vue)