vue 中 Type of the default value for ‘data’ prop must be a function的解决方案
vue官方文档
搭配es6语法简单粗暴解决
props: {
dataList: {
type: Object,
default: () => ({
a:1,
b:2
})
}
}
vue官方文档
搭配es6语法简单粗暴解决
props: {
dataList: {
type: Object,
default: () => ({
a:1,
b:2
})
}
}