首页 > 其他分享 >2022-09-06 Invalid default value for prop "value": Props with type Object/Array must use

2022-09-06 Invalid default value for prop "value": Props with type Object/Array must use

时间:2022-09-26 12:11:51浏览次数:62  
标签:function return default Invalid value Props type

前言:父级给子组件传值,子组件接收传递过来的变量报错:

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

子组件接收传参写法:

  props: {
    value: {      
      type: String,
      default: "",
    },
  }

解决方案:把default的写法换成这样

标签:function,return,default,Invalid,value,Props,type
From: https://www.cnblogs.com/iuniko/p/16730438.html

相关文章