vue 子组件总会出现奇奇怪怪的错误
错误如下
Props with type Object/Array must use a factory function to return the default value.
具体原因
你的props属性定义的default有问题
你的应该是
cardList: {
type: Array,
default: []
},
cardInfo: {
type: Object,
default: {},
},
修改成这种就可以
cardList: {
type: Array,
default: () => []
},
cardInfo: {
type: Object,
default: () => {},
},