1👍
✅
tipDetails
is initialized as null
, and then bound to <TipDetailsDialog>.tip
, which causes it to try to render tip.test
(where tip
is null
).
Since TipDetailsDialog
doesn’t really render anything meaningful without a populated tip
, that component should probably be conditionally rendered only when tipDetails
is truthy:
<TipDetailsDialog v-if="tipDetails" :tip="tipDetails" />
-1👍
tipDetails
is initialized asnull
, and then bound to
<TipDetailsDialog>.tip
, which causes it to try to rendertip.test
(wheretip
isnull
).Since
TipDetailsDialog
doesn’t really render anything meaningful
without a populatedtip
, that component should probably be
conditionally rendered only whentipDetails
is truthy:
html <TipDetailsDialog v-if="tipDetails" :tip="tipDetails" />
Or you can set a default value to the prop:
props: {
tip: {
type: String,
required: false,
default: () => ""
},
},
Source:stackexchange.com