iter(g175): 确认气泡支持异步确认

This commit is contained in:
HIsheR
2026-10-26 16:23:23 +08:00
parent 66c39e0145
commit cbce645b3b
6 changed files with 30 additions and 14 deletions
+6
View File
@@ -1370,6 +1370,12 @@ const content = h(
onCancel: () => toast.info('已取消'),
}, button({ label: '删除记录', variant: 'danger' })),
popconfirm({ title: '发布到生产?', description: '发布后 1 分钟内全量生效。', confirmText: '发布', onConfirm: () => toast.success('已发布') }, button({ label: '发布', variant: 'ghost' })),
popconfirm({ // 异步确认:Promise 期间按钮转「处理中…」并禁用,成功才收起
title: '归档这批任务?',
description: '调用后端需要约 1 秒,期间按钮保持 loading,失败则留在气泡里可重试。',
confirmText: '归档',
onConfirm: async () => { await new Promise((r) => setTimeout(r, 1000)); toast.success('已归档'); },
}, button({ label: '归档(异步)', variant: 'ghost' })),
),
section(
'sec-calendar',