Q:Invalid default value for prop "value": Props with type Object/Array must use a factory function to return the default value.
A:
list:{
type: [Object,Array],
default: ()=>{}
},
arr:{
type: Array,
default: ()=>[]
},
obj:{
type: Object,
default: ()=>{}
}
Q: You are binding v-model directly to a v-for iteration alias. This will not be able to modify the v-for source array because writing to the alias is like modifying a function local variable. Consider using an array of objects and use v-model on an object property instead.
A:
<div v-for="(item,i) in list">
<xx v-model="item"/> 错误
<xx v-model="list[i]"/> 正确
</div>