Tiny simple central event bus plugin for Vue.js

Last update: Aug 8, 2022

vue-bus

awesome-vue license

A tiny simple central event bus plugin for Vue.js (requires Vue >= 2.0).

The plugin realise Non Parent-Child Communication.

(655 byte gzip)

Installation

Download and use with your build system

import VueBus from 'vue-bus'
// ... maybe ...
var VueBus = require('vue-bus')

// ...  and  ...

Vue.use(VueBus)

Or just include it with a script tag

<script src="/vue-bus.js"></script>

โœจ

Usage

direct way:

// in component A's method
this.$bus.$emit('my-event', 1)

// in component B's created hook
this.$bus.$on('my-event', function(arg) {
  // ...
})

//And don't forget to use "this.$bus.$off" to remove unnecessary listeners.

magic way:

// in component A's method
this.$bus=['my-event', 1]

// in component B create $bus option
methods: { /* ... */ },
$bus: {
  'my-event': function(arg) {
    // ...
  }
}

License

MIT

Copyright (c) 2017 fffixed

GitHub

https://github.com/fffixed/vue-bus
You might also like...

Vue directive plugin for drag event detection.

v-dragged Vue directive plugin for drag event detection. NOTE: This directive listens for mouse/touch events, and sets a handler for when a drag actio

Aug 11, 2022

Vue directive plugin for drag event detection.

v-dragged Vue directive plugin for drag event detection. NOTE: This directive listens for mouse/touch events, and sets a handler for when a drag actio

Jun 6, 2022

Event handling plugin for VueJS

A Vue.js plugin that provides a global event bus and a couple helper methods. Works with both Vue 1.0 & Vue 2.0. Installation 1.) Install package via

Jul 30, 2020

Simple event handling for Vue.js

vue-events A Vue.js plugin that simplify events. Works with both Vue 1.0 & Vue 2.0. Installation 1.) Install package via Yarn or NPM $ yarn add vue-ev

Apr 20, 2022

๐Ÿ•Vue Final Modal is a tiny, renderless, mobile-friendly, feature-rich modal component for Vue.js.

๐Ÿ•Vue Final Modal is a tiny, renderless, mobile-friendly, feature-rich modal component for Vue.js.

Vue Final Modal Looking for a Vue 3 version? It's over here ๐ŸŽ‰ Documentation ๐Ÿ™Œ Examples Introduction Vue Final Modal is a renderless component! You c

Aug 12, 2022

Vue Mountable is a tiny DOM Library for Vue 3.

Vue 3 Component DOM Mounting

Apr 30, 2022

๐Ÿ•Vue Final Modal is a tiny, renderless, mobile-friendly, feature-rich modal component for Vue.js.

๐Ÿ•Vue Final Modal is a tiny, renderless, mobile-friendly, feature-rich modal component for Vue.js.

๐Ÿ•Vue Final Modal is a tiny, renderless, mobile-friendly, feature-rich modal component for Vue.js.

Aug 4, 2022

๐ŸŒŒ A slick, yet tiny lightbox gallery for Vue.js

vue-tinybox A slick, yet tiny lightbox gallery for Vue.js Slick. No excessive design. Pictures, thumbnails, controls. Tiny. Dependency-free. 3 KB mini

Jul 17, 2022

Tiny vue component that adds a directive for parallax effect on elements.

vue-parallax-js Tiny vue component that adds a directive for parallax effect on elements. no dependencies lightweight 1.3k gzip Setup npm install --sa

Jun 20, 2022

Tiny FontAwesome 5 component for Vue.js.

vue-fa Tiny FontAwesome 5 component for Vue.js. FontAwesome svg icons Tree-shakable, only import used icons No CSS file required FontAwesome duotone i

Jul 5, 2022

Tiny (2k gzipped) and dependency free mask input for Vue.js

Tiny (2k gzipped) and dependency free mask input for Vue.js

The Mask A lightweight (2KB gzipped) and dependency free mask input created specific for Vue.js Docs and Demo JsFiddle Install yarn add vue-the-mask o

Aug 15, 2022

A tiny Drawer component with bounced animation for Vue ๐Ÿšช๐ŸŽ๐Ÿ—„๐Ÿ”›

A tiny Drawer component  with bounced animation for Vue ๐Ÿšช๐ŸŽ๐Ÿ—„๐Ÿ”›

vue-simple-drawer TODO remove shadow for default style add cover layer option rename the scss vars nest drawer? Install npm install vue-simple-drawer

Feb 16, 2022

A tiny Vue directive that stop propagation scroll when edge reached

A tiny Vue directive that stop propagation scroll when edge reached

vue-scroll-stop A tiny Vue directive that stop propagation scroll when edge reached. Works with desktop mousewheel and mobile touchmove events โœ… On โŒ

Feb 4, 2022

A Vue component for create a tiny pagination with Flexbox

Tiny Pagination ยท A Vue component for create a tiny paginate with Flexbox Install/Usage # Install with npm $ npm i -S vue-tiny-pagination # or yarn $

Mar 12, 2021

Tiny Vue component for Electron to open links in a browser. Ideal for cross environment apps (Web & Native)

Vue Flexible Link Tiny Vue Component to open links in a browser, ideal for cross environment apps(Web and Native Desktop with Electron) If you are in

Sep 14, 2021

๐Ÿ”ก Tiny input mask library for Vue.js (directive)

๐Ÿ”ก Tiny input mask library for Vue.js (directive)

Aug 7, 2022

A tiny (198 bytes) state manager for React/RN/Preact/Vue/Svelte with many atomic tree-shakable stores

A tiny (198 bytes) state manager for React/RN/Preact/Vue/Svelte with many atomic tree-shakable stores

A tiny (198 bytes) state manager for React/RN/Preact/Vue/Svelte with many atomic tree-shakable stores

Aug 12, 2022

Vue.js client-side for tiny, quick-loading, node.js-less Single Page Apps.

Client-Side Vue.js Vue.js client-side for tiny, quick-loading, node.js-less Single Page Apps. Demo client-side-vue/ index.html - The entry-point for y

Sep 8, 2021

๐Ÿ”ฆ Tiny reusable spotlight component for your Vue App

V-Spotlight ๐Ÿ”ฆ Tiny reusable Spotlight component for your Vue App Demo Link - Click Here This is on GitHub so let me know if I've b0rked it somewhere,

Jan 1, 2022
Event handling plugin for VueJS

A Vue.js plugin that provides a global event bus and a couple helper methods. Works with both Vue 1.0 & Vue 2.0. Installation 1.) Install package via

Jul 30, 2020
Simple event handling for Vue.js

vue-events A Vue.js plugin that simplify events. Works with both Vue 1.0 & Vue 2.0. Installation 1.) Install package via Yarn or NPM $ yarn add vue-ev

Apr 20, 2022
The event manager for Vue.js

vue-event-manager The plugin for Vue.js provides a declarative way to bind events to a global event manager. It uses the Vue lifecycle to automaticall

Apr 23, 2022
Helper function for emitting events in Vue.js (functional) components

Vue emit Helper function to emit events from Vue.js functional components. Can be used in regular components too. CodeSandbox demo Installation yarn a

Mar 31, 2022
Vue event bus plugin listening for online/offline changes
Vue event bus plugin listening for online/offline changes

vue-connection-listener Vue event bus plugin listening for online/offline changes About Whenever the navigator's connection status changes a 'connecti

Jul 15, 2022
A Vue js Global Event Bus plugin using the power of Observable

Vue-geb - Global Event Bus Vue-geb is a vue Global Event Bus plugin to help broadcast events across the app using the power of observables. Only add 5

Jan 14, 2021
Demo of global event bus usage in vue

This is a quick example of how to use a global event bus to your advantage with vue-geb. Why ? I use a global event bus mainly to split my UI interact

Jul 17, 2018
Web application for organization of foodsaving groups worldwide - frontend code and central location for feature planning. For server-side code, go to https://github.com/yunity/karrot-backend
Web application for organization of foodsaving groups worldwide - frontend code and central location for feature planning. For server-side code, go to https://github.com/yunity/karrot-backend

A web platform to support foodsaving groups worldwide. ?? ?? ?? karrot (Frontend) (Backend) This is the frontend repository, i.e. the browser-side sof

Aug 15, 2022
A database of all Indian law (Acts, Rules, Ordinances, Amendments, etc.) of both Central and States' legislation by CA @ManasMadrecha

indianlaw Build Setup # install dependencies $ npm install # serve with hot reload at localhost:3000 $ npm run dev # build for production and launch

Dec 26, 2021
Event portal for associations that enables an information flow to the members and to simplify the member and event management

EventPortal Event portal for associations that enables an information flow to the members and to simplify the member and event management. Starting Vu

Feb 21, 2022