Files
workspace/code/g3soft-libs/docs/examples/notification/basic.vue
T
2026-10-08 22:38:34 +08:00

27 lines
750 B
Vue

<script setup lang="ts">
// 与 Message 的区别:带标题与描述,默认停留更久(4500ms),适合承载需要阅读的信息
import { G3Button, G3Notification, G3Space } from '@g3soft/ui'
</script>
<template>
<G3Space :size="[8, 8]" wrap>
<G3Button
type="outline"
@click="
G3Notification.success({ title: '发布成功', description: '版本 1.2.0 已上线,5 分钟后全量生效' })
"
>
成功通知
</G3Button>
<G3Button
type="outline"
@click="
G3Notification.error({ title: '构建失败', description: '单元测试未通过,点击查看日志', duration: 0 })
"
>
不自动关闭的错误通知
</G3Button>
</G3Space>
</template>