primevue-mirror/components/confirmationservice/ConfirmationService.js

19 lines
568 B
JavaScript
Raw Normal View History

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