In my project using Vue3 with Nuxt, I encountered an issue. My goal is to initialize an empty array of objects and then populate it.
let results = ref([]);
results.value = [
{
"name": input.value,
}
]
However, I am receiving the following error message:
Type '{ name: string; }' is not assignable to type 'never'.
I attempted the following solution:
let results: any[] = ref([]);
I also referred to the v-for documentation in Vue, but the example mentioned initializes a non-empty array of objects:
const items = ref([
{
message: 'Foo'
},
{
message: 'Bar'
}
])