Files
Aether/frontend/src/components/ConfirmContainer.vue
2025-12-10 20:52:44 +08:00

26 lines
665 B
Vue

<template>
<AlertDialog
:model-value="state.isOpen"
:title="state.title || '确认操作'"
:description="state.message"
:confirm-text="state.confirmText || '确认'"
:cancel-text="state.cancelText || '取消'"
:type="state.variant || 'question'"
@update:model-value="handleClose"
@confirm="handleConfirm"
@cancel="handleCancel"
/>
</template>
<script setup lang="ts">
import AlertDialog from './common/AlertDialog.vue'
import { useConfirm } from '@/composables/useConfirm'
const { state, handleConfirm, handleCancel } = useConfirm()
function handleClose(value: boolean) {
if (!value) {
handleCancel()
}
}
</script>