我想在
沒有提供道具時標記。但我收到“Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'title')”錯誤。
<p>{{ section.title }}</p>
export default {
props: {
section: Object,
default: {
type: "section",
title: "Introduction Props",
desc: "",
children: [
{
type: "lecture",
title: "Introduction",
},
],
}
},
};
uj5u.com熱心網友回復:
你必須重新排列你的道具:
export default {
props: {
section: {
type: Object,
default: () => {
type: "section",
title: "Introduction Props",
desc: "",
children: [
{
type: "lecture",
title: "Introduction",
}
]
}
},
};
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/455344.html
上一篇:v-for與子物件
