♻️ refactor: useConfirmModal composable updated
This commit is contained in:
parent
5f8a7ae4c2
commit
2dda891c43
|
@ -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 };
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user