Vue报错 Invalid default value for prop “list“: Props with type Object/Array must use a factory

简介: Vue报错 Invalid default value for prop “list“: Props with type Object/Array must use a factory

Vue报错 Invalid default value for prop “list”: Props with type Object/Array must use a factory function to return the default value.解决办法

错误提示:

Invalid default value for prop “XX”: Props with type Object/Array must use a factory function to return the default value.

问题分析:

这其实是一个语法问题,在使用prop的时候,这个数组定义的方法写错了。

解决办法:

替换写法

如果大家觉得有用的话,可以关注我下面的微信公众号,极客李华,我会在里面更新更多行业资讯,企业面试内容,编程资源,如何写出可以让大厂面试官眼前一亮的简历,让大家更好学习编程,我的抖音,B站也叫极客李华。

相关文章
|
4月前
vue3-admin-element-template配置正向代理报错
vue3-admin-element-template配置正向代理报错
61 0
|
7天前
|
JavaScript
vue学习(7)Object.defineProperty
vue学习(7)Object.defineProperty
22 2
|
1月前
|
Docker 容器
成功解决:Caused by: ParsingException[Failed to parse object: expecting token of type [START_OBJECT] but
这篇文章讨论了在使用Docker启动Elasticsearch容器时遇到的一个具体问题:由于配置文件`elasticsearch.yml`解析出错导致容器启动失败。文章提供了详细的排查过程,包括查看容器的日志信息、检查并修正配置文件中的错误(特别是空格问题),并最终成功重新启动了容器。
|
1月前
|
JSON 数据格式 Python
【python】解决json.dump(字典)时报错Object of type ‘float32‘ is not JSON serializable
在使用json.dump时遇到的“Object of type ‘float32’ is not JSON serializable”错误的方法,通过自定义一个JSON编码器类来处理NumPy类型的数据。
49 1
java.lang.Error: Unresolved compilation problem: The type List is not generic; it cannot be parame
java.lang.Error: Unresolved compilation problem: The type List is not generic; it cannot be parame
|
2月前
|
JSON 前端开发 数据格式
【Python】已解决:TypeError: Object of type JpegImageFile is not JSON serializable
【Python】已解决:TypeError: Object of type JpegImageFile is not JSON serializable
48 0
|
2月前
|
开发者 Python
【Python】已解决:TypeError: descriptor ‘index‘ for ‘list‘ objects doesn‘t apply to a ‘str‘ object
【Python】已解决:TypeError: descriptor ‘index‘ for ‘list‘ objects doesn‘t apply to a ‘str‘ object
62 0
ValidationError: Invalid options object. Dev Server has been initialized using an options object tha
ValidationError: Invalid options object. Dev Server has been initialized using an options object tha
|
4月前
|
JavaScript
Vue : Object.defineProperty()
Vue : Object.defineProperty()
37 2
|
3月前
|
存储 NoSQL Redis
Redis第四弹,Redis实现list时候做出的优化ziplist(压缩链表,元素少的情况),可更好的节省空间list——(内部编码:quicklist)Object encoding
Redis第四弹,Redis实现list时候做出的优化ziplist(压缩链表,元素少的情况),可更好的节省空间list——(内部编码:quicklist)Object encoding