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

140
Views
Vue si declaración mientras muestra datos de api

Obtengo algunos datos de una Api y quiero verificar si el vtype es "auto". Así es como hago un bucle:

 <tr v-for="vehicles_group in vehicles_groups.data" :key="vehicles_group.gid"> <td> <input type="checkbox"> </td> <!-- <td>{{ vehicles_groups.gid }} </td> --> <td>{{ vehicles_group.title }}</td> <td>{{ vehicles_group.vtype }}</td> <td>{{ vehicles_group.company }}</td> <td>{{ vehicles_group.active }}</td> <td>{{ vehicles_group.priceincludes }}</td> <td>{{ vehicles_group.categories }}</td> <td>{{ vehicles_group.earlybook }}</td> <td>{{ vehicles_group.earlybook }}</td> </tr>

¿Hay alguna forma en vue de verificar si el valor de una salida Api es algo de la consola del automóvil?

Por ejemplo

 if {{ vehicles_group.vtype }} == car{ console.log('its a car', vehicles_group.vtype ) }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Por supuesto.

Si desea utilizar v-if en su plantilla:

 <td v-if="vehicles_group.vtype == 'car'"> It's a car </td> <td v-else> It's not a car </td>

Si desea esto en el código JavaScript de su componente, puede hacerlo como de costumbre:

 if (vehicles_group.vtype == "car") { console.log('its a car', vehicles_group.vtype ) }
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!