2024-12-18 08:42:00 +08:00
|
|
|
import mitt from 'mitt'
|
|
|
|
|
|
|
|
type Events = {
|
2025-01-13 21:51:37 +08:00
|
|
|
openPost: IPost
|
|
|
|
startLoading: boolean
|
|
|
|
eventBus: INotification
|
2024-12-18 08:42:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default defineNuxtPlugin(() => {
|
2025-01-13 21:51:37 +08:00
|
|
|
const emitter = mitt<Events>()
|
2024-12-18 08:42:00 +08:00
|
|
|
|
2025-01-13 21:51:37 +08:00
|
|
|
return {
|
|
|
|
provide: {
|
|
|
|
mitt: emitter,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|