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)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章