1、错误写法
demo:{
type:Array,
default:[]
}
eslint语法报错:
Invalid default value for prop “demo”: Props with type Object/Array must use a factory function to return the default value.
2、正确的写法应该是:
demo: {
type: Array,
default: function () {
return [
1、错误写法
demo:{
type:Array,
default:[]
}
eslint语法报错:
Invalid default value for prop “demo”: Props with type Object/Array must use a factory function to return the default value.
2、正确的写法应该是:
demo: {
type: Array,
default: function () {
return [