22 lines
637 B
JavaScript
22 lines
637 B
JavaScript
|
import ToastEventBus from 'primevue/toasteventbus';
|
||
|
import { PrimeVueToastSymbol } from 'primevue/usetoast';
|
||
|
|
||
|
export default {
|
||
|
install: (app) => {
|
||
|
const ToastService = {
|
||
|
add: (message) => {
|
||
|
ToastEventBus.emit('add', message);
|
||
|
},
|
||
|
removeGroup: (group) => {
|
||
|
ToastEventBus.emit('remove-group', group);
|
||
|
},
|
||
|
removeAllGroups: () => {
|
||
|
ToastEventBus.emit('remove-all-groups');
|
||
|
}
|
||
|
};
|
||
|
|
||
|
app.config.globalProperties.$toast = ToastService;
|
||
|
app.provide(PrimeVueToastSymbol, ToastService);
|
||
|
}
|
||
|
};
|