What are correct Typescript types for input events in Vue? When I use Event
it is missing target value or key or files properties.
Let's have an example for:
<input @input="(e: MISSING_TYPE) => {}" />
<input @keypress="(e: MISSING_TYPE) => {}" />
In React we have something like ChangeEvent which is generic and apply element specific types. How we do it in Vue?
target
is on theEvent
type. I think you'd need to cast to something more specific to get value, i.e. (<HTMLInputElement>e.target).value – Amati