Props with type Object/Array must use a factory function to return the default value.
父子传值,报错代码:

报错信息:
Props with type Object/Array must use a factory function to return the default value.(数组/对象的默认值应当由一个工厂函数返回)
解决办法:
1、箭头函数
props: { actData: { type: Object, default: () => {}, }, },
2、普通函数
props: { actData: { type: Object, default: function () { return {}; }, }, },

浙公网安备 33010602011771号