Modal component not work in Livewire #416
Unanswered
tegarmonster
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I was wondering why, Modal Component works for the first load if using Livewire,
I was adding this script on app.js file
`import 'preline';
document.addEventListener('livewire:navigate', () => {
HSStaticMethods.autoInit();
});
document.addEventListener('livewire:navigating', () => {
HSStaticMethods.autoInit();
});
document.addEventListener('livewire:navigated', () => {
HSStaticMethods.autoInit();
});
`
also include this script into main blade component
``
@Vite(['resources/css/app.css', 'resources/js/app.js'])
but the Javascript cannot load if I move to another page or navigate.. any ideas?
Beta Was this translation helpful? Give feedback.
All reactions