Notify 通知提醒框
展示通知提醒信息,带有交互的通知,给出用户下一步的行动点。。
基础用法
只需调用组件方法osNotify即可。
js
import { osNotify } from 'osui'
osNotify.closeAll() // 关闭全部
osNotify('this is message...')带状态的提示
用来显示「成功、警告、错误」类的操作反馈。
可通过设置type来改变状态,分别为primary,success,warning,danger,不设置状态时不显示前缀图标。
js
import { osNotify } from 'osui'
osNotify({
type: 'success',
message: 'this is success message...'
})位置
可以让 Notify 从屏幕四角中的任意一角弹出
使用 position 属性设置 Notify 的弹出位置, 支持四个选项:top-right、top-left、bottom-right 和 bottom-left, 默认为 bottom-right。
js
import { osNotify } from 'osui'
osNotify({
position: 'top-right',
message: 'this is message...'
})隐藏关闭图标
可设置showClose是否显示关闭图标。
js
import { osNotify } from 'osui'
osNotify({
duration: 6000,
showClose: false,
message: 'this is message...'
})取消自动关闭
提示会在设置duration规定时间内自动隐藏(默认为3秒)如果设置为0则不会自动关闭,会一直在页面上
js
import { osNotify } from 'osui'
osNotify({
duration: 0,
showClose: true,
message: 'this is message...'
})