Vue自定义组件Props中接收数组
文章目录
问题
报错
props: {
showcontent: {
type: Array,
default: []
},
}报错信息
问题解决
props: {
showcontent: {
type: Array,
default: function () { return [] }
},
}ES6
props: {
showcontent: {
type: Array,
default: () => []
},
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论