更新记录
1.0.2(2020-04-28)
1、调整预览图 2、添加注意事项
1.0.0(2020-02-17)
无
平台兼容性
Vue2 | Vue3 |
---|---|
√ | × |
App | 快应用 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节小程序 | QQ小程序 |
---|---|---|---|---|---|---|
× | × | × | × | × | × | × |
钉钉小程序 | 快手小程序 | 飞书小程序 | 京东小程序 |
---|---|---|---|
× | × | × | × |
H5-Safari | Android Browser | 微信浏览器(Android) | QQ浏览器(Android) | Chrome | IE | Edge | Firefox | PC-Safari |
---|---|---|---|---|---|---|---|---|
× | × | × | × | × | × | × | × | × |
使用方式
引入
import Vue from 'vue'
import Toast from './components/zg-toast/zg-toast.js';
Vue.use(Toast);
基本
this.$toast("默认");
改变位置
this.$toast({
content:"上",
location:"top"
})
显示时间
this.$toast({
content:"上",
delay: 5000
})
对象参数
属性名 | 数据类型 | 说明 | 值 |
---|---|---|---|
content | string | 内容 | |
location | string | 位置 | top、center、bottom,默认为center |
delay | number | 显示时间 | 默认为:3000 |
注意:本插件中使用了
document
对象,请确保你的环境支持