vue 父子元件傳陣列eslint報錯(Type of the default value for ‘arrNew‘ prop must be a function)
阿新 • • 發佈:2021-01-13
技術標籤:筆記2021javascriptvue
報錯
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)