props父传子类型Object
当父传子类型是Object时,props定义类型如下
1.父vue
<ArticleInfo
v-for="item in artlist"
:cover="item.cover"
></ArticleInfo>
2.子vue
type定义应为Object,
default定义为function
cover: {
type: Object,
default: function () {
return {
type: 0,
};
},
},