Invalid default value for prop “options”: Props with type Object/Array must use a factory function to return the default value.
.(props default 数组/对象的默认值应当由一个工厂函数返回)
vue问题记录(五):Invalid default value for prop "options": Props with type Object/Array must use a factory
今天在写代码的时候,控制台报了这个错误,然后在网上查阅了资料,就是刚刚那个后面的翻译的意思
props default 数组/对象的默认值应当由一个工厂函数返回

错误代码:

  options: {
            type: Array,
            default: [],
        },

解决方法:

 // 表格数据
        options: {
            type: Array,
            default: ()=>[]
        },

相关文章:

  • 2021-10-24
  • 2021-12-04
  • 2021-05-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-16
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
  • 2021-12-16
相关资源
相似解决方案