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.

Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →