Strange behavior passing data from server to Alpine 3 #1621
Unanswered
gushonorato
asked this question in
1. Help
Replies: 2 comments 3 replies
-
I'm seeing this as well, using Livewire. The workaround I've found is to hard-code the data object and update the value I want Alpine to watch on <div x-data="{ show: false }" x-init="show = {{ json_encode($show) }}"> The following doesn't work: <div x-data="{ show: {{ json_encode($show) }} }"> Oddly, if I watch the value of the |
Beta Was this translation helpful? Give feedback.
3 replies
-
@calebporzio should we open an issue to fix that? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! First of all, thanks for your incredible work.
I was upgrading to Alpine version 3 in my project when I ran into a strange behavior on version 3.
On version 2, I was able to do this:
When I update the
@open
variable on LiveView (but it could be any Live*** framework) side, theopen
variable on Alpine side is also updated. But this is not happening anymore on version 3.This different behavior is by design or I've just found a bug?
Beta Was this translation helpful? Give feedback.
All reactions