项目作者: lawliet467

项目描述 :
简单易用的vue toast插件
高级语言: Vue
项目地址: git://github.com/lawliet467/vue-simple-toast.git
创建时间: 2019-02-13T08:36:16Z
项目社区:https://github.com/lawliet467/vue-simple-toast

开源协议:MIT License

下载


简介

一个非常轻量的移动端toast组件

预览

效果图

使用方法

下载toast文件夹,放在vue项目中,然后在入口文件main.js引入、安装,如:

  1. import Vue from 'vue'
  2. import toast from './toast'
  3. Vue.use(toast)

可直接传入字符串或数字

  1. this.$toast.show('Hello World')

也可以这样自定义持续时间

  1. this.$toast.show({
  2. message: 'Hello World',
  3. duration: 2000
  4. })

隐藏toast

  1. this.$toast.hide()

备注

组件使用的是rem单位,因为项目中有做rem适配。可自行在toast.vue中修改样式

License

MIT

Copyright (c) 2019-present lawliet467