variable sending from livewire component to js code is not working
Hello, I am trying to send variable from livewire component to javascript code. I have a page with js code and @livewire component with it own class. I am using
in one of the last code lines I am sending data ( I think here is the problem). Javascript code:
I thought that i catched data correctly, but i cant see even a console.log message. Can someone help, please?
Solution:Jump to solution
I understand that I sent variable correctly, but i can access it via js only in livewire.user-activity-form (livewire class view), but not the blade view
13 Replies
where is the js?
in a blade file also in this blade file I included livewire class:
if you want to access
video_start
in the LW component view, you don't need to dispatch it. Just use $wire
i want to access it in javascript which is inside a blade view. This blade view contains @livewire component from where i am trying to get variable and a javascript code, where i want to use it
could you share the whole code on Gist?
you are missing
)
in the document.addEventListener
..remove
livewire:initialized
and try only $wire.on
1 min
still the same problem
maybe you could create a mini repo on Github only to reproduce this issue, without unrelated code, and I can take a look
thank you for your help, i really appreciate it, but not today, it is very late in my country
Solution
I understand that I sent variable correctly, but i can access it via js only in livewire.user-activity-form (livewire class view), but not the blade view
hum, custom-learning-resource isn't a lw component? Is it a Filament page?
yes, it is not a livewire