[Vuejs]-How to set up Vue 3 Composition API (Typescript) to push user-inputted value to array

4👍

You need to declare typing for listItems like this:

const listItems = ref<string[]>([]);

otherwise TypeScript won’t know what type of array listItems is

👤Owl

Leave a comment