Learn Vue JS course Learn Javascript and Vue JS Learn VueJS course Learn VueJS Tutorial

TypeScript with Vue.js 3

Get access to the most comprehensive Vue.js video library in the world. Over 300 video lessons including the newest Vue 3 features.

Typing Template Refs

In this lesson, we learn how to work with Vue’s template refs in TypeScript. Since template refs only exist after the component is mounted, it’s necessary to type template refs with a union type that includes the DOM element type as well as null.