[Solved] View+ts $refs error: Property ‘previewHotel’ does not exist on type ‘Element’.

Questions:
this.$refs.districtMap.previewHotel(this.newHotel)
Error Messages:
Property ‘previewHotel’ does not exist on type ‘Element | Element[] | Vue | Vue[]’.
Property ‘previewHotel’ does not exist on type ‘Element’.
Solution:
(this.$refs.districtMap as Vue & {previewHotel:Function}).previewHotel(this.newHotel)
Reason:
TS type

Similar Posts: