primevue-mirror/components/confirmationservice/ConfirmationService.js

17 lines
564 B
JavaScript
Raw Normal View History

2022-09-06 12:03:37 +00:00
import ConfirmationEventBus from 'primevue/confirmationeventbus';
import {PrimeVueConfirmSymbol} from 'primevue/useconfirm';
export default {
install: (app) => {
const ConfirmationService = {
require: (options) => {
ConfirmationEventBus.emit('confirm', options);
},
close: () => {
ConfirmationEventBus.emit('close');
}
};
app.config.globalProperties.$confirm = ConfirmationService;
app.provide(PrimeVueConfirmSymbol, ConfirmationService);
}
};