How can I integrate Metrinic with Livewire using `wire:navigate`? When I use JavaScript, it stops working after navigating to another page.
Hi,
Thank you for reaching out to us.
At the moment we haven't tried combining Metronic 9 with Livewire.
Are you getting errors when using wire:navigate
?
Regards,
Lauris Stepanovs,
Keenthemes Support Team
I don't have any errors but the JS doesn't load with wire:navigate
Hi,
Can you try to refer to https://keenthemes.com/metronic/tailwind/docs/getting-started/integration/vue guide and initialize the components globally via the KTComponents.init() method?
The SPA integration guide should be similar to Laravire as well.
You can also refer to the starter kit apps for Metronic 9 Tailwind:
https://github.com/keenthemes/metronic-tailwind-html-integration
Regards,
Sean
Would it work for Livewire? Where would you put init in app.js?
Hi Alex,
As mentioned above we haven't tried combining Livewire with the latest Metronic version.
Generally in all freamworks, the javascript initialization can be done the same way as we do in our Vue version by calling KTComponents.init()
.
I guess in Livewire javascript files must be placed within the @script
and @endscript
. You can refer to this section which explains how to use and execute javascript in Liverwire.
Regards,
Lauris Stepanovs,
Keenthemes Support Team