Skip to content

Instantly share code, notes, and snippets.

View balbalcode's full-sized avatar

Ikbal Maulana balbalcode

View GitHub Profile
@YoshiTheChinchilla
YoshiTheChinchilla / BaseAlert.vue
Last active April 19, 2021 05:30
Simple Event Bus pattern in Vue.js and Nuxt.js
<template>
</template>
<script>
// Import the Event Bus of Vue instance
import { EventBus } from './event-bus.js'
export default {
created() {
(this.$nuxt || EventBus || this.$EventBus).$on('open-alert', this.openAlert)