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

114
Views
How to get id from the checkbox to check if is checked or not in vue3
<div>
  <input 
    type="checkbox" 
    class="delete-checkbox" 
    :id=this.products[index].sku  
    @click="setDelete(this.products[index].sku)" />
</div>

I'm building an vuex app and I try to start an event when this checkbox is checked but I don't know how to do this.

Can somebody help me, please?

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

0

Pls check out following snippet:

const demo = {
  data() {
    return {
      products: [{sku: 1}, {sku: 2}, {sku: 3}],
    };
  },
  methods: {
    setDelete(id) {
      console.log('event fired for: ' + id)
    }
  },
};
Vue.createApp(demo).mount("#demo");
<script src="https://unpkg.com/vue@next"></script>
<div id="demo">
  <li v-for="(product, idx) in products" :key="idx">
    <input type="checkbox" class="delete-checkbox" :id="product.sku" @click="setDelete(product.sku)">
  </li>
</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!