Skip to content

vue3

事件总线

vue3 取消了事件总线。如果要使用,需要自己下载。

shell
npm install --save mitt

找到 vue 项目中的 utils 文件夹,新建一个 bus.js:

js
import mitt from "mitt"; 
const emitter = mitt() 
export default emitter

Released under the MIT License.