# vue-event-emitter **Repository Path**: kingsmart/vue-event-emitter ## Basic Information - **Project Name**: vue-event-emitter - **Description**: 为vue2.js设计的事件传播系列方法。 - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-18 - **Last Updated**: 2022-05-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # vue-event-emitter 为vue2.js设计的事件传播系列方法。

downloads install size CDN Version License GitHub repo stars

## 如何使用 首先,在你的```vue```项目中进行安装: ```bash npm install --save vue-event-emitter ``` 安装完成以后引入并注册: ```js import eventEmitter from 'vue-event-emitter'; // 安装 Vue.use(eventEmitter); ``` 然后,我们就可以在项目中使用了: ```js // 向上发射事件 this.$upEmitter(eventName:string,param:any); // 向下发射事件 this.$downEmitter(eventName:string,param:any); ``` 如果某个地方希望接受上面发射的事件,直接通过```$on```注册即可: ```js this.$on(eventName:string,param:any=>{ // todo }); ``` 开源协议 --------------------------------------- [MIT](https://github.com/hai2007/vue-event-emitter/blob/master/LICENSE) Copyright (c) 2021 [hai2007](https://hai2007.gitee.io/sweethome/) 走一步,再走一步。