laravel livewire alpine tutorial code example
Example 1: passing livewire variable in alpine js
You can share data between livewire and apline js using : @entangle
class Counter extends Component
{
public $showDropdown = false;
}
<div x-data="{ open: @entangle('showDropdown') }">
Example 2: laravel alpine dropdown
<div x-data="{ open: false }">
<button @click="open = true">Open Dropdown</button>
<ul
x-show="open"
@click.away="open = false"
>
Dropdown Body
</ul>
</div>