Notification 全局通知
全局信息提示组件。
何时使用
当需要向用户全局展示提示信息时使用,显示数秒后消失。
基本用法
消息标题
消息类型
超时时间
关闭回调
组件方式调用
Service 使用
// 方式1,局部引入 NotificationService
import { NotificationService } from '@devui/vue-devui/notification';
NotificationService.open({ xxx });
// 方式2,全局属性
this.$notificationService.open({ xxx });
Notification 参数
| 参数名 | 类型 | 默认 | 说明 | 跳转 | 
|---|---|---|---|---|
| v-model | boolean | 'false' | 组件调用必选,控制是否显示 | 组件方式调用 | 
| content | string | '' | 可选,设置消息内容 | 基本用法 | 
| title | string | '' | 可选,设置消息标题 | 消息标题 | 
| type | NotificationType | 'normal' | 可选,设置消息类型 | 消息类型 | 
| duration | number | '3000' | 可选,设置超时时间 | 超时时间 | 
| on-close | () => void | '' | 可选,设置消息关闭时的回调 | 关闭回调 | 
Notification 插槽
| 插槽名 | 说明 | 
|---|---|
| default | 默认插槽,组件方式使用时有效 | 
类型定义
NotificationType
type NotificationType = 'normal' | 'success' | 'error' | 'warning' | 'info';
