primevue-mirror/components/confirmationservice/ConfirmationService.js

19 lines
568 B
JavaScript

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);
}
};