1、新建event-bus.ts文件 import Vue from 'vue' Vue.prototype.$bus = new Vue(); 可以全局使用 2、nuxt.config.js中添加eventbus变量 可以通过root全局使用 plugins: ['~/plugins/swiper.ts', '~/plugins/element-ui.ts'