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

94
Views
v-for over array y establecer entrada

Estoy recorriendo un json en mi plantilla que funciona bien.

Ahora tengo una array que puede ver a continuación y quiero recorrer esta matriz y quiero ingresar el primer number en mi primer v-model b-form-input y :value , el segundo en la segunda forma b- entrada y así sucesivamente.

Entonces mi indexChild es igual al lugar del número que debe ingresarse. ( indexChild = 0 <-> place of number in my array = 0 -> Entrada: 7011412 )

¿Cómo puedo solucionar eso?

 <template> <div v-for="(item, indexChild) in json" :key="indexChild"> <div class="mt-2">Input</div> <!-- v-for="item in array" :key="item" --> <!-- this doesn't work! --> <b-form-input v-model="???" :value="???" type="number"></b-form-input> </div> </template>

mi matriz:

 ['7011412', '7012912', '7689012']

se ve así en la consola: ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Podría simplemente establecer el modelo v y el valor en json[indexChild]
Luego, su modelo v se establece en el valor de la matriz en el índice dado

 <div v-for="(item, indexChild) in json" :key="indexChild"> <div class="mt-2">Input</div> <!-- v-for="item in array" :key="item" --> <!-- this doesn't work! --> <b-form-input v-model='json[indexChild]' :value="json[indexChild]" type="number"></b-form-input> </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!