Vetur: $refs of ref... Property '$refs' does not exist on type 'Element'.

Created on 5 Mar 2020  路  1Comment  路  Source: vuejs/vetur

vscode 1.42.1, vetur 0.24.0, ubuntu 19.10
image
Screenshot from 2020-03-05 14-41-02

But the application works as intended

question

Most helpful comment

It is intensional behavior and not related to Vetur as the $refs type is just defined like that. As $refs items can be anythings (HTMLElement, Vue component...), you need to manually cast it.

const contact = this.$refs.contact as any
contact.$refs.emailField.focus()

>All comments

It is intensional behavior and not related to Vetur as the $refs type is just defined like that. As $refs items can be anythings (HTMLElement, Vue component...), you need to manually cast it.

const contact = this.$refs.contact as any
contact.$refs.emailField.focus()
Was this page helpful?
0 / 5 - 0 ratings

Related issues

octref picture octref  路  3Comments

Dealerpriest picture Dealerpriest  路  3Comments

pdanpdan picture pdanpdan  路  3Comments

muhajirdev picture muhajirdev  路  3Comments

deangoku picture deangoku  路  3Comments