0
I am developing a Feature that lists products and their status (enabled, disabled). To choose the state of the product, I am using a checkbox in toggle-switch format.
<div class="col-md-6 col-xl-10" v-for="product in products" :key="product.id">
.
.
.
<i class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" :id="product.id" v-model="product.status">
<label class="custom-control-label" for="customSwitches"> {{ product.status }} </label>
</i>
To make this checkbox dynamic, I tried to use the checkbox with the id referencing the product :id="product.id"
.
The problem that when I used this way, the checkbox stops working, is always false and by clicking it does not change the state (nor graphically).
Thank you very much! Solved here!
– Matheus Costa
You can use the @change directive in this input?
– Matheus Costa
@Matheuscosta No. But you can hear a change event in the input or else extract the inline assignment for a method and create the rule you want
– Lucas Caires