UNPKG

drip-ui

Version:

Lightweight Mobile UI Components built on Vue

53 lines (45 loc) 1.03 kB
## Notify 轻提示 ### 使用指南 ``` javascript import { Notify } from 'drip-ui'; Vue.use(Notify); ``` ### 代码演示 ```html <drip-button @click="showNotify1">错误提示</drip-button> <drip-button @click="showNotify2">警告提示</drip-button> <drip-button @click="showNotify3">正确提示</drip-button> <drip-button @click="showNotify4">消息提示</drip-button> ``` ```javascript showNotify1 () { this.$notify({ content: '错误提示' }) }, showNotify2 () { this.$notify({ content: '警告提示', type: 'warning' }) }, showNotify3 () { this.$notify({ content: '正确提示', type: 'success' }) }, showNotify4 () { this.$notify({ content: '消息提示', type: 'info', duration: 10000 }) } ``` ### API | 参数 | 说明 | 类型 | 默认值 | |-----------|-----------|-----------|-------------| | content | 提示内容 | `String` | - | | type | 提示类型 `error` `warning` `info` `success` | `String` | `error` | | duration | 展示时间 | `Number` | 3000 |