vue 父子组件传数组eslint报错(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)

posted @ 2021-01-12 20:46  易函123  阅读(497)  评论(0编辑  收藏  举报