dimanche 2 octobre 2022

Activate checkbox if I click on the label [Vue.js]

I was watching this youtube tutorial for making a toggle component.

https://www.youtube.com/watch?v=J0hp2NF5OzU&ab_channel=LaurentPerrier

On the 23th second of the video he shows that if you click on the label, the checkbox is activated. I have the same code, but it doesn't work for me. I must click on the checkbox itself in order to activate it. Here is my code.

<div class="wrapper">
    <input type="checkbox" id="checkbox">
    <label for="checkbox">this is my label</label>
</div>

I see nothing different in my code. Did they change somthing in Vue? I am using version 3.2.40




Aucun commentaire:

Enregistrer un commentaire