Hi,
I was wondering what could be the reason that @entangle
value is always true
on view side when the page is loaded. The behavior is normal when we change the value. The divs
are inside the . If I extract them out @entangle
normal from the initialization. To compensate for that i used x-init="show = @this.dshow"
Test.php
...
class Test extends Component
{
public $dshow = false;
....
}
view.blade.php
<x-jet-dialog-modal>
...
<x-slot name="content">
<div style="max-height: 70vh">
<div x-data="{ show : @entangle('dshow') }">
<label>
<input type="checkbox" value="1" wire:model="dshow" />
Check me
</label>
<div x-show="show">
This will be shown after you check abve
</div>
</div>
</div>
</x-slot>
</x-jet-dialog-modal>
The above will not hide the div on load, but after we check and then uncheck the div is toggled as I wanted. I used x-init
to force initial state. What could possibly be the reason? Is it a bug?