2024-02-21 14:27:32 +00:00
|
|
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
|
|
|
import { useQuasar } from 'quasar';
|
|
|
|
|
2024-03-19 16:50:15 +00:00
|
|
|
export function useVnConfirm() {
|
2024-02-21 14:27:32 +00:00
|
|
|
const quasar = useQuasar();
|
|
|
|
|
|
|
|
const openConfirmationModal = (title, message, promise, successFn) => {
|
|
|
|
quasar
|
|
|
|
.dialog({
|
|
|
|
component: VnConfirm,
|
|
|
|
componentProps: {
|
|
|
|
title: title,
|
|
|
|
message: message,
|
|
|
|
promise: promise,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
.onOk(async () => {
|
|
|
|
if (successFn) successFn();
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
return { openConfirmationModal };
|
|
|
|
}
|