passing livewire variable in alpine js 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: Sharing State Between Livewire And Alpine

You can sharing variable between livewire and alpine using : @entangle

class Counter extends Component
{
    public $showDropdown = false;
}

<div x-data="{ open: @entangle('showDropdown') }">

Tags:

Misc Example