♻️ 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";
|
import VButton from "../button/VButton.vue";
|
||||||
|
|
||||||
export function useConfirmModal() {
|
export function useConfirmModal() {
|
||||||
const confirm = useConfirm();
|
|
||||||
|
|
||||||
const showConfirmModal = ({
|
const showConfirmModal = ({
|
||||||
acceptProps = VButton,
|
acceptProps = VButton,
|
||||||
rejectProps = VButton,
|
rejectProps = VButton,
|
||||||
|
@ -12,15 +10,17 @@ export function useConfirmModal() {
|
||||||
header = '',
|
header = '',
|
||||||
message = '',
|
message = '',
|
||||||
icon = '',
|
icon = '',
|
||||||
accept = Function,
|
accept = () => {},
|
||||||
reject = Function,
|
reject = () => {},
|
||||||
onHide = Function,
|
onHide = () => {},
|
||||||
onShow = Function,
|
onShow = () => {},
|
||||||
modal = true,
|
modal = true,
|
||||||
blockScroll = true,
|
blockScroll = true,
|
||||||
position = 'center',
|
position = 'center',
|
||||||
appendTo = 'body',
|
appendTo = 'body',
|
||||||
}: ConfirmationOptions) => {
|
}: ConfirmationOptions) => {
|
||||||
|
const confirm = useConfirm();
|
||||||
|
|
||||||
confirm.require({
|
confirm.require({
|
||||||
group,
|
group,
|
||||||
header,
|
header,
|
||||||
|
@ -36,7 +36,9 @@ export function useConfirmModal() {
|
||||||
blockScroll,
|
blockScroll,
|
||||||
position,
|
position,
|
||||||
appendTo,
|
appendTo,
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
return {showConfirmModal}
|
|
||||||
|
return { showConfirmModal };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user