在vue 父子组件传参过程中,传递对象或者数组时,设置默认值为{}或者[]
错误写法:
props: { pos: { type: [Object, Array], default: []//这是错误的!!! } },
正确的写法:
props: { pos: { type: [Object, Array], default: function(){ return [] } } },