u
This commit is contained in:
1 parent
f572dce2f6
commit
e99a9fb274
356 files changed
+28877
-1055
No files matched your search
@@ -0,0 +1,34 @@
|
||||
<script setup lang="ts">
|
||||
// 命令式确认框:G3Modal.confirm(options) 返回 { destroy }
|
||||
import { G3Button, G3Message, G3Modal, G3Space } from '@g3soft/ui'
|
||||
|
||||
function openConfirm() {
|
||||
G3Modal.confirm({
|
||||
title: '确定删除该分支?',
|
||||
content: '删除后不可恢复,关联的构建记录会一并清理。',
|
||||
confirmText: '删除',
|
||||
cancelText: '再想想',
|
||||
confirmButtonProps: { danger: true },
|
||||
onConfirm: () => G3Message.success('已删除'),
|
||||
onCancel: () => G3Message.info('已取消'),
|
||||
})
|
||||
}
|
||||
|
||||
// destroy:不等退场动画直接卸载(例如路由切换时清理)
|
||||
let handle: ReturnType<typeof G3Modal.confirm> | null = null
|
||||
|
||||
function openAndDestroy() {
|
||||
handle = G3Modal.confirm({
|
||||
title: '3 秒后强制销毁',
|
||||
content: 'destroy() 会立即关闭并卸载容器,不播放退场动画。',
|
||||
})
|
||||
setTimeout(() => handle?.destroy(), 3000)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<G3Space :size="12" wrap>
|
||||
<G3Button type="danger-outline" @click="openConfirm">删除确认</G3Button>
|
||||
<G3Button type="outline" @click="openAndDestroy">演示 destroy()</G3Button>
|
||||
</G3Space>
|
||||
</template>
|
||||
Reference in new issue
Block a user