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

289
Views
Vue.js, sintaxis bootstrap-vue de cadena y variable concatenadas

Tengo un problema de sintaxis con '="collapse-{{ product.id }}"' tanto en el botón b como en el colapso b. ¿Cómo debe formarse esto? Solo trato de crear una identificación única que vincule el botón a la etiqueta de colapso.

 <b-list-group header="List Product 1"> <b-list-group-item :variant="product.inventoryStatus? 'success': 'danger'" style="min-width: 30%; max-width: 30%" :border-variant="product.inventoryStatus ? 'success' : 'danger'" align="center" v-for="product in productList" :key="product.id"> <b-button vb-toggle="collapse-{{ product.id }}" class="m-1">{{ product.name }}</b-button> <b-collapse id="collapse-{{ product.id }}"> Price: {{ product.price }}<br> Brand: {{ product.brand }}<br> <p :bg-variant="product.inventoryStatus? 'success': 'danger'">{{product.inventoryStatus ? 'IN STOCK': 'OUT OF STOCK'}}</p> <table> <tr> <td> <b-button variant="danger" @click="deleteProduct(product.id)"> <i class="fa fa-trash"></i></b-button> </td> <td> <UpdateProduct :product="product"/> </td> </tr> </table> </b-collapse> </b-list-group-item> </b-list-group>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede crear un method y pasarle el product.id y usar el valor de return

Demo en vivo

Demostración de Codesandbox

 :vb-toggle="getToggleValue( product.id )"

y define el método como:

 methods: { getToggleValue(id) { return `collapse-${id}`; }, },
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!