Skip to content

Notify 通知

悬浮于角落, 用于显示重要的消息, 呆在角落也许更加让人留意

TIP

和Message一样,都是基于messageBox开发的, 因此会有许多相似的属性. 相似的某些属性使用可以查看Message 消息.

基础用法

  • title 指定通知的标题
  • text 指定通知的文本内容
  • timeout 指定通知的存活时间

Notify的宽度固定为300px且标题不会换行,因此Notify的标题需要简练,过长标题将会被省略。

不同的状态

可以通过 type 指定通知的类型

不同的方位

使用 placement 指定通知出现的位置, 可出现在[右上角(默认), 右下角, 左上角, 左下角]

Notify API

Notify Props

属性名说明类型默认值
title通知的标题Stringdefault title
text通知的内容String---
type类型'success' | 'info' | 'warning' | 'danger'---
placement方位'top-right' | 'bottom-right' | 'bottom-left' | 'top-left'top-right
timeout存活时间Number3000ms
offset距离上一条消息的偏移量Number10px
icon自定义消息的图标String---
color自定义消息图标的颜色String---

源代码

组件

贡献者

Released under the MIT License.