项目作者: yuicer

项目描述 :
vue的toast插件
高级语言: Vue
项目地址: git://github.com/yuicer/vue-toast.git
创建时间: 2019-01-03T13:10:19Z
项目社区:https://github.com/yuicer/vue-toast

开源协议:

下载


vue-toast

instroction

vue-ui-plugin for mobile,

install

  1. npm i @yuicer/vue-toast

usage

  1. import toast from '@yuicer/toast'
  2. Vue.use(toast)
  3. // within vue components
  4. this.$toast.alert('hello').then()
  5. // within js , must be used after installed 【Vue.use(toast)】
  6. import { toast } from '@yuicer/toast'
  7. toast
  8. .confirm('hello')
  9. .then()
  10. .catch()

options

toast has three functions【tip, alert confirm】, all of them return a promise with properly value

  1. toast.tip( msg: String, { durationTime?: Number = 1500 } )
  2. toast.alert( msg: String, { words? :String = '确定' } )
  3. toast.confirm( msg: String, { words? :String[2] = ['取消', '确认'] } )

undo