Skip to content

lifetin/vue-globa-event

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-globa-event

vue全局事件

Build Setup

#安装
npm install vue-globa-event -S

#引用
在main.js中引用并加载

import vueGlobaEvent from "vue-globa-event";
Vue.use(vueGlobaEvent);


#使用方法
在A页面中发布消息
this.$Event.emit('login_success',{a:'111',b:'222',c:3333});

在B页面或C,D,E,F.... 中监听事件

this.$Event.on('login_success', function (rs) {
    console.log(rs);
});

每个路由中的页面都会独立收到消息,互不干扰



About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published