Open standuprey opened 2 years ago
I figured a way to type $refs on third party components
$refs
In my case, I want to know the height of a v-list-item-group (vuetify):
v-list-item-group
<v-list-item-group :value="value" ref="container" >...</v-list-item-group>
$refs!: { container: Vue };
This works fine until I try to get this.$refs.container.$el.offsetHeight it complains with
this.$refs.container.$el.offsetHeight
Property 'offsetHeight' does not exist on type 'Element'
Is that a bug in Element's type?
Element
You need to make a type assertion to HTMLElement.
I figured a way to type
$refs
on third party componentsIn my case, I want to know the height of a
v-list-item-group
(vuetify):This works fine until I try to get
this.$refs.container.$el.offsetHeight
it complains withProperty 'offsetHeight' does not exist on type 'Element'
Is that a bug in
Element
's type?