mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-06 17:52:29 +08:00
26 lines
665 B
Vue
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> |