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

282
Views
¿Cómo podría acceder a los datos en un v-for? Marco VueJS + Quasar

Tengo el siguiente código, es una tabla de marcado q para obtener productos de una consulta de búsqueda. Cuando la tabla se llena con productos de la consulta, agregué un botón para seleccionar una fila, la fila seleccionada enviará los datos de la fila a una matriz y enviará esa matriz a otra tabla llamada "productos seleccionados", pero ¿cómo puedo acceder a la v-para datos (es decir: producto.nombre) para enviarlo a la nueva matriz?

 <q-markup-table flat bordered separator="cell"> <thead class="bg-blue-grey-1"> <tr> <th class="text-left">Nombre</th> <th class="text-right">Descripcion</th> <th class="text-right">Precio</th> <th></th> </tr> </thead> <tbody v-for="producto in productos" :key="producto.producto_id"> <tr> <td class="text-left">{{ producto.nombre }}</td> <td class="text-right">{{ producto.descripcion }}</td> <td class="text-right">{{ "$" + producto.precio }}</td> <td class="text-right"> <q-btn flat class="text-primary" label="Seleccionar" @click="agregarProducto" ></q-btn> </td> </tr> </tbody> </q-markup-table>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Pasar el producto a agregarProducto , así...

 @click="agregarProducto(producto)"

Añadir el objeto completo a la selección...

 methods: { agregarProducto(producto) { this.selectedProducts.push(producto); // see? console.log('first price is', this.selectedProducts[0].precio); }
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!