Notify 消息通知

使用指南

  • 在 app.json 或 index.json 中引入notify组件
    {
      "usingComponents": {
        "fs-button": "path/components/notify/index"
      }
    }
    
    1
    2
    3
    4
    5
  • 在页面中插入节点
<fs-notify id="fs-notify"/>
1
  • 在js中引入notify并使用
import Notify from '../../components/notify/notify'
Notify('通知内容')
1
2

代码演示

  • 基本使用
Notify('通知内容')
1
  • 自定义配置
Notify({
  text: '通知内容',
  duration: 1000,
  selector: '#custom-notify',
  backgroundColor: '#1989fa'
})
1
2
3
4
5
6

属性

参数 说明 类型 默认值
selector 节点的id String #fs-notify
duration 时长 Numer 3000
text 通知内容 String -
color 文字颜色 String #fff
backgroundColor 背景色 String red