I have a component PageViewer
with props defined like this
props: {
page: DocumentPageDto,
},
I use it in another Vue like as so
<div><PageViewer:page="selectedPage"></PageViewer></div>
selectedPage
is set as a response from an API call which leads to this warning in the console
Invalid prop: type check failed for prop "page". Expected DocumentPageDto, got Object
Which I understand, the response from the API is just a plain old Object
I wonder if Vue has a way of dealing with this, I want to keep the prop type declaration as DocumentPageDto
for intellisense.
Does Vue have a way of dealing with this, can I ignore the type check?
Thanks
Instead of declaring props like
props: {
page: DocumentPageDto,
}
Use a property and apply the @Prop
decorator from the vue-property-decorator library works just fine.
@Prop()
diagram: DiagramDto = null;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.