diff --git a/src/components/composable/useConfirmModal.ts b/src/components/composable/useConfirmModal.ts index 0bf333b..429b620 100644 --- a/src/components/composable/useConfirmModal.ts +++ b/src/components/composable/useConfirmModal.ts @@ -3,8 +3,6 @@ import { useConfirm } from "primevue"; import VButton from "../button/VButton.vue"; export function useConfirmModal() { - const confirm = useConfirm(); - const showConfirmModal = ({ acceptProps = VButton, rejectProps = VButton, @@ -12,15 +10,17 @@ export function useConfirmModal() { header = '', message = '', icon = '', - accept = Function, - reject = Function, - onHide = Function, - onShow = Function, + accept = () => {}, + reject = () => {}, + onHide = () => {}, + onShow = () => {}, modal = true, blockScroll = true, position = 'center', appendTo = 'body', }: ConfirmationOptions) => { + const confirm = useConfirm(); + confirm.require({ group, header, @@ -36,7 +36,9 @@ export function useConfirmModal() { blockScroll, position, appendTo, - }) - } - return {showConfirmModal} + }); + }; + + return { showConfirmModal }; } +