Custom Javascript inside widget
Excuse me for my ignorance, but I'm trying to understand the right way to use custom javascript inside Filament widget. Maybe I'm missing something basic, but I just can't get it to work. Case example here is swiper.js.
I'm loading Swiper library & css in AppServiceProvider:
I've tried couple approaches:
1) Init the script inside widget
2) FilamentView::registerRenderHook('panels::body.end'
Now if I render my test code using the renderHook, it works. But inside Livewire component it will not.
Here is how to init the library:
Here is a test HTML:
2 Replies
Does this discussion, and the solution we came to, help? https://discord.com/channels/883083792112300104/1157105855565676544
Amazing, thank you so much @DrByte ! This did indeed solve my dilemma.