# wepy2 > https://gitee.com/hlgshare/wepy2-template.git *** ### package.json ![](https://img.kancloud.cn/01/94/01943ec54a655cacba47f69364457a33_602x531.png) ## **组件通信** **实例化 common/eventHub** ``` import wepy from '@wepy/core' let eventHub = new wepy() export default eventHub ``` **pages/index 发送通知** ``` import eventHub from '../common/eventHub' eventHub.$emit('app-launch', { a: 1 }, { b: 2 }) ``` **pages/index 引入监听** ``` import eventHub from './common/eventHub' eventHub.$on('app-launch', (...args) => { console.log('app-launch event emitted, the params are:') console.log(args) }) ``` *** ## **应用原生第三方组件** **示例 package.json miniprogram-slide-view** ![](https://img.kancloud.cn/e6/17/e6175daff80ca0b9583963b0795e99cf_491x138.png) **引用** ![](https://img.kancloud.cn/93/27/93279e64222c0dd4e1e792a386bb02f4_757x222.png) ``` <config> { usingComponents: { "slide-view": "module:miniprogram-slide-view", } } </config> ```