Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't push javascript to @stack('script') #12

Open
afzalursyaref opened this issue Feb 2, 2022 · 3 comments
Open

can't push javascript to @stack('script') #12

afzalursyaref opened this issue Feb 2, 2022 · 3 comments

Comments

@afzalursyaref
Copy link

i can't push javascript event listener, ex: livewire:load

@michele-grifa
Copy link

I also tried to push some script to a stack, but without success.

@danyderigon
Copy link

Hi.
No update on this issue ?

@danyderigon
Copy link

Actually I just realized that we don't have to push in stack.

This method works very well on my side. Add this to your blade modal


<div>
    {{-- Your html--}}
</div>

<script type="text/javascript">

    $(document).ready(function () {

        // do whatever you want...

        window.Livewire.hook('component.initialized', (component) => {})
        window.Livewire.hook('element.initialized', (el, component) => {})
        window.Livewire.hook('element.updating', (fromEl, toEl, component) => {})
        window.Livewire.hook('element.updated', (el, component) => {})
        window.Livewire.hook('element.removed', (el, component) => {})
        window.Livewire.hook('message.sent', (message, component) => {})
        window.Livewire.hook('message.failed', (message, component) => {})
        window.Livewire.hook('message.received', (message, component) => {})
        window.Livewire.hook('message.processed', (message, component) => {})

    });


</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants