feature: useConfirmModal composable added

This commit is contained in:
Paul Valerie GOMA 2025-07-28 09:11:29 +02:00
parent 77f4e5460a
commit 88fd6ec0d2

View File

@ -0,0 +1,42 @@
import { type ConfirmationOptions } from "primevue/confirmationoptions";
import { useConfirm } from "primevue";
import VButton from "../button/VButton.vue";
export function useConfirmModal() {
const confirm = useConfirm();
const showConfirmModal = ({
acceptProps = VButton,
rejectProps = VButton,
group = '',
header = '',
message = '',
icon = '',
accept = Function,
reject = Function,
onHide = Function,
onShow = Function,
modal = true,
blockScroll = true,
position = 'center',
appendTo = 'body',
}: ConfirmationOptions) => {
confirm.require({
group,
header,
message,
icon,
rejectProps,
acceptProps,
accept,
reject,
onHide,
onShow,
modal,
blockScroll,
position,
appendTo,
})
}
return {showConfirmModal}
}