Currently, I am in the process of learning how to use Vue3 + Typescript. Previously, I have developed Vue2 applications using plain JavaScript. In my current project, I am attempting to define a reactive variable within the setup()
function:
setup() {
// defining a single note
interface Note {
id: string
creationDate: string
text: string
tags: string[]
deleted: boolean
}
// holding all notes in the app
let allNotes: ref(Note[]) // ← this implementation is incorrect
let allnotes: Note[] // ← this syntax is correct but non-reactive
(...)
}
I am seeking assistance with the proper syntax for creating a reactive Array of Note
. Can someone provide guidance on this matter?