1.0.4 • Published 3 years ago
iw-message v1.0.4
仿elementUI el-message弹窗
安装
npm i iw-message
使用
import {iwMessage} from 'iw-message'
iwMessage('你好iw-message')
iwMessage.success('成功')
iwMessage.error('错误')
iwMessage.warning('警告')
iwMessage.info('默认')
Options
iwMessage({
type: 'success',
message: '你好',
duration: 3000,
onClose: (data) => {
console.log(data)
}
})
参数 | 说明 | 类型 | 可选值 |
---|---|---|---|
type | 主题 | string | success/warning/info/error |
message | 消息文字 | string | - |
duration | 显示时间, 毫秒 | number | - |
onClose | 关闭时的回调函数, 参数为被关闭的 message 实例 | function | - |