Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
Typscript: ¿Cómo llamo a la matriz anidada en Vue Data?

Creé una interfaz con el siguiente código:

 export interface ISubcategories { subCategoryTopic: string; subCategoryImageURL: string; subCategoryImage: ISubcategoryImages[]; } export interface ISubcategoryImages { podcastImageURL: string; videoImageURL: string; articleImageURL: string; } export interface ICategories { categoryTopic: string; subCategory: ISubcategories[]; }

Lo llamé en la sección de datos de mi código vuejs con:

 categoryData: { categoryTopic: "" as string, subCategory: [] as Array<ISubcategories>, },

Sin embargo, cuando agrego el siguiente código al cuadro de texto donde quiero que estén los datos, aparece este error :

_vm.categoryData.subCategory.subCategoryImage no está definido.

Qué tengo que hacer ?

 v-model="categoryData.subCategory.subCategoryImage.podcastImageURL"
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Una observación : como subCategory & subCategoryImage en la interfaz ISubcategories se define como una matriz. No puede acceder a su objeto directamente con notación de dot(.) . Puede acceder a los elementos a través de índice o por iteración.

Por ejemplo:

 <div v-for="(subCat, index) in categoryData.subCategory" :key="index"> <div v-for"(imageUrl, i) in subCat.subCategoryImage" :key="i"> <input v-model="imageUrl.podcastImageURL"/> </div> </div>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!