Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

share data between livewire and 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') }">
--------------- OR -----------------
<div x-data="{ open: @entangle('showDropdown').defer }">
  
With this you dont need to use wire model with that data Like
wire:model.defer="showDropdown"
 
PREVIOUS NEXT
Tagged: #share #data #livewire #alpine #js
ADD COMMENT
Topic
Name
9+6 =