vue prop 會接收不一樣的數據類型,這裏列出了 經常使用的數據類型的設置默認值的寫法,其中包含: Number, String, Boolean, Array, Function, Object vue
refAge: {
type: Number,
default: 0
},
refName: {
type: String,
default: ''
},
hotDataLoading: {
type: Boolean,
default: false
},
hotData: {
type: Array,
default: () => {
return []
}
},
getParams: {
type: Function,
default: () => () => {}
},
meta: {
type: Object,
default: () => ({})
}