Imagine a scenario where you have the following rough pseudo code:
<v-menu
ref="dmenu"
other="stuff here"
@change="save"
>
Later in your code, you reference it like this:
save(val: string) {
this.$refs.dmenu.save(val)
}
An error message pops up saying "Property 'save' does not exist on type 'Element'"
The question arises - is there a way to define that items on this.$refs.
are of type any?
One solution is to do the following:
save(val) {
const m = this.$refs.dmenu as any
m.save(val)
}
This resolves the issue with Typescript, but it feels like an unnecessary extra step just for compliance.