1.0.2 • Published 4 years ago
vue-mini-toast
简单的vue的弹窗插件(pop/alert/confirm/actionSheet)
安装
npm install vue-mini-toast -S
Vue中使用
// main.js
import toast from 'vue-mini-toast'
Vue.use(toast);
API
this.$pop(option);
| 参数 | 类型 | 可选含义 |
|---|
| msg | String | 提示内容 |
| align | String | 弹框位置:top/middle(默认)/bottom |
| theme | String | 弹窗颜色:black(默认黑底白字)/light(白底黑字) |
| delay | Number | 自动消失时间(默认2000ms) |
this.$alert(option, callback);
| 参数 | 类型 | 可选含义 |
|---|
| title | String | 标题 |
| msg | String | 弹窗内容 |
| btn | String | 按钮文字(默认‘确定’) |
| btnColor | String | 按钮文字颜色(默认蓝色) |
this.$confirm(option, callback);
this.$actionSheet(option, callback);
| 回调参数 | 含义 |
|---|
| item | 点击的按钮文字内容 |
| index | 点击的按钮index值 |