报错
props: {
showcontent: {
type: Array,
default: []
},
}
[Vue warn]: Invalid default value for prop "showcontent": Props with type Object/Array must use a factory function to return the default value.
props: {
showcontent: {
type: Array,
default: function () { return [] }
},
}
ES6
props: {
showcontent: {
type: Array,
default: () => []
},
}