[Vue warn] : Props with type Object/Array must use a factory function to return the default value.

解决方案:

把props中的

props:{
    obj:{
        type:Object,
        default:{}
    },
},

修改为

props:{
    obj:{
        type:Object,
        default:()=>{}
    },
},

原理:

系统报错Invalid default value for prop "slides": Props with type Object/Array must use a factory function to return the default value.提示Array/Object的默认返回值要用工厂形式返回。

发布了94 篇原创文章 · 获赞 29 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/weixin_41849462/article/details/86693820