Message 消息提示 (函数式)
轻量级 toast 通知。
ts
import { useMessage } from '@aether/ui'
const msg = useMessage()
msg.success('操作成功')
msg.error('操作失败')
msg.warning('请注意')
msg.info('提示信息')API
ts
msg.success(content, duration?) // 成功
msg.error(content, duration?) // 错误
msg.warning(content, duration?) // 警告
msg.info(content, duration?) // 信息| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| content | string | — | 消息内容 |
| duration | number | 3000 | 持续时间 ms |
Notification 通知 (函数式)
丰富的通知卡片。
ts
import { useNotification } from '@aether/ui'
const notify = useNotification()
notify.open({ title: '提示', content: '操作成功', type: 'success' })
notify.success('成功', '数据已保存')
notify.error('失败', '请重试')| 参数 | 类型 | 说明 |
|---|---|---|
| title | string | 标题 |
| content | string | 内容 |
| type | 'info'|'success'|'warning'|'error' | 类型 |
| duration | number | 持续 ms |
| closable | boolean | 可关闭 |
| placement | 'top-right'|'top-left'|'bottom-right'|'bottom-left' | 位置 |