props: {
commentInfo: {
type: Array,
default() {
return [];
}
}
},
//這里的type是一個數組,但是父傳子時卻傳過來一個對象,所以報錯
//把type和return改回Object即可
props: {
commentInfo: {
type: Object,
default() {
return {};
}
}
},