Consider the following, in a blade template:
<template x-for="(product, index) in getProducts()" :key="index">
<li class="flex items-center px-1 py-3 rounded-md hover:bg-gray-50">
<label class="flex items-center justify-between hover:cursor-pointer">
<input type="checkbox" name="products[]" x-bind:value="product.id" class="cursor-pointer form-checkbox" {{ $attributes->wire('model') }} />
</label>
[..]
</li>
</template>
I'm using it as follow:
<x-forms.product-selector wire:model.lazy="activeProducts" />
When playing with checkboxes, nothing happens (i.e no event is fired for livewire).
Would anyone have an idea of what I'm doing wrong ? Thanks
wire:model doesn't work inside template