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

244
Views
Cómo agregar una clase al elemento principal cuando la casilla de verificación está marcada en Vue.js 2.0

¿Es posible usar un estado marcado de casilla de verificación para agregar una clase al div principal? Si no, ¿cómo hacerlo? Aquí está el código:

 <div class="checkbox-container" v-for="item in items" :key="item.id" :class="{'checked': checkbox.checked}" // I wanna do something like that > <input type="checkbox" :id="item.id" :value="item.value" v-model="checkedItems"> <label :for="item.id">{{ item.text }}</label> </div>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Solo usa el valor de v-model

 :class="{'checked': checkedItems.includes(item.value) }"
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!