项目作者: BillyLuo

项目描述 :
a custom alert tip
高级语言: JavaScript
项目地址: git://github.com/BillyLuo/alert.git
创建时间: 2020-07-31T09:45:28Z
项目社区:https://github.com/BillyLuo/alert

开源协议:

下载


alert.js

一个简单的网页提示,css完全借鉴bootstrap alert

如何使用

  • 网页中直接引入js, css
  • var Alert = require(‘will-alert’)
  • 引用示例
  1. Alert.alert({
  2. type: 'primary',
  3. content: '一个超级简单的提示'
  4. })

or

  1. Alert.success('hello, world', 4000)

API

Alert.alert(option)

option:

字段名称 类型 说明
type String 提示类型,备选’primary’, ‘secondary’, ‘success’, ‘danger’, ‘warning’, ‘info’,’error’, ‘light’
content String 内容,可以为HTML
duration Int 出现时间,单位毫秒,默认3000

example:

  1. Alert.alert({
  2. type: 'success',
  3. content: '操作成功',
  4. duration: 4000
  5. })
  1. 另提供Alert.success(content: String, duration: Int)(上述类型primary, success...)等函数

tips

  1. 移动端使用时不要超过三行字,否则会有些许bug

License

MIT