♻️ refactor: useConfirmModal composable updated
This commit is contained in:
parent
ef57a78a03
commit
dc288d42bb
|
@ -3,6 +3,8 @@ import { useConfirm } from "primevue";
|
|||
import VButton from "../button/VButton.vue";
|
||||
|
||||
export function useConfirmModal() {
|
||||
const confirm = useConfirm();
|
||||
|
||||
const showConfirmModal = ({
|
||||
acceptProps = VButton,
|
||||
rejectProps = VButton,
|
||||
|
@ -10,17 +12,15 @@ export function useConfirmModal() {
|
|||
header = '',
|
||||
message = '',
|
||||
icon = '',
|
||||
accept = () => {},
|
||||
reject = () => {},
|
||||
onHide = () => {},
|
||||
onShow = () => {},
|
||||
accept = Function,
|
||||
reject = Function,
|
||||
onHide = Function,
|
||||
onShow = Function,
|
||||
modal = true,
|
||||
blockScroll = true,
|
||||
position = 'center',
|
||||
appendTo = 'body',
|
||||
}: ConfirmationOptions) => {
|
||||
const confirm = useConfirm();
|
||||
|
||||
confirm.require({
|
||||
group,
|
||||
header,
|
||||
|
@ -36,9 +36,7 @@ export function useConfirmModal() {
|
|||
blockScroll,
|
||||
position,
|
||||
appendTo,
|
||||
});
|
||||
};
|
||||
|
||||
return { showConfirmModal };
|
||||
})
|
||||
}
|
||||
return {showConfirmModal}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user