https://github.com/Almoullim/vue-tabevents
Event-Based communication across opened tabs for Vue 2.x
https://github.com/Almoullim/vue-tabevents
events javascript vue-plugin vuejs
Last synced: 8 days ago
JSON representation
Event-Based communication across opened tabs for Vue 2.x
- Host: GitHub
- URL: https://github.com/Almoullim/vue-tabevents
- Owner: Almoullim
- License: mit
- Created: 2018-11-02T20:59:38.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-03T19:45:28.000Z (over 1 year ago)
- Last Synced: 2025-10-26T12:47:17.998Z (26 days ago)
- Topics: events, javascript, vue-plugin, vuejs
- Language: JavaScript
- Homepage:
- Size: 453 KB
- Stars: 33
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-vue - vue-tabevents - Event-Based communication across opened tabs for Vue 2.x ` 📝 3 years ago` (UI Utilities [🔝](#readme))
- awesome-vue - vue-tabevents
- awesome-vue - vue-tabevents ★18
- awesome-vue - vue-tabevents
- fucking-awesome-vue - vue-tabevents
- awesome-vue - vue-tabevents
README
# vue-tabevents
[](https://www.npmjs.com/package/vue-tabevents)
[](https://github.com/almoullim/vue-tabevents/releases)
[](https://github.com/almoullim/vue-tabevents/blob/master/LICENSE)
[](https://www.jsdelivr.com/package/npm/vue-tabevents)
[](https://travis-ci.org/Almoullim/vue-tabevents)
Easy communication between tabs for Vue 2.x

## Getting Started
### Installing
Install with npm:
```bash
npm install --save vue-tabevents
```
import into project:
```js
import Vue from 'vue';
import vueTabevents from 'vue-tabevents';
Vue.use(vueTabevents);
```
## Usage
To an emit event to other tabs
```
this.$tabEvent.emit('eventName');
const data = {
name: 'Ali'
phone: 123
}
this.$tabEvent.emit('eventName', data);
```
To listen for events emitted by other types
```
this.$tabEvent.on('eventName', callback);
this.$tabEvent.on('eventName', (data) => console.log(data));
```
To stop listening to an event
```
this.$tabEvent.off('eventName');
```
## Authors
- **Ali Almoullim** - [almoullim](https://github.com/almoullim)
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE) file for details