乐趣区

关于javascript:Type-of-the-default-value-for-‘arrNew‘-prop-must-be-a-function

报错

Type of the default value for ‘arrNew’ prop must be a function. (vue/require-valid-default-prop)

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

解决

arrNew: {
  type: Array,
  default() {return []
  }
}

vue 父子组件传数组 eslint 报错 (Type of the default value for ‘arrNew’ prop must be a function).md)

退出移动版