The issue I'm facing is related to Vetur underlining 'null' in the following line:
const firstRef = ref<HTMLElement>(null)
<template>
<input id="first" ref="firstRef">
<button type="button" @click.prevent="focusFirst">Focus</button>
</template>
<script lang="ts">
import { defineComponent, ref } from "@vue/composition-api"
export default defineComponent({
name: "Test",
setup() {
const firstRef = ref<HTMLElement>(null)
const focusFirst = () => {
const theField = firstRef.value
theField.focus()
}
return { focusFirst }
}
</script>