[Vuejs]-Correct typing with typescript on "nameless" key

0👍

It is not an array of Quiz, it is an indexed object of Quiz. Use a Record utility type

export type QuizIndex = Record<string, Quiz>;

Or with an index signature

export interface QuizIndex {
  [quizId: string]: Quiz;
}

Leave a comment