Skip to content Skip to footer navigation

Event Bus

For situations where emitting an event to the parent component doesn’t make sense, Statamic has a global event bus. You can emit and listen to events directly on this which will be available to all Vue components.

// Emit from some component...
this.$events.$emit('event.name');
 
// Listen for it in another component...
this.$events.$on('event.name');
Hot Tip!

The event bus is intended to be used for Vue component communication. If you want to listen for Statamic driven “events”, check out Hooks.

A troll pointing a teaching stick