mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-12 04:28:28 +08:00
Initial commit
This commit is contained in:
26
frontend/src/components/ConfirmContainer.vue
Normal file
26
frontend/src/components/ConfirmContainer.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user