How do I trigger from outside the scope? #651
Closed
bakbuz
started this conversation in
4. General
Replies: 1 comment 1 reply
-
That's in the docs under https://github.com/alpinejs/alpine#dispatch Essentially you fire a custom event on one component and listen for it on another <button x-data @click="$dispatch('custom-event', 'Hello World!')">
<div x-data @custom-event.window="console.log($event.detail)"></div> |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello guys! I have a question.
How do I trigger from outside the scope?
Example:
https://codepen.io/bakbuz/pen/abdjExQ?editors=1011
Best regards
Beta Was this translation helpful? Give feedback.
All reactions