0.1.1 • Published 6 years ago

vue-toast5 v0.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

vue-toast

a modified version from vue-easytoast

Install

npm install vue-toast5 -S

yarn add vue-toast5

QuickStart

require('vue-toast5/dist/vue-toast.css');

// in ES6 modules
import toast from 'vue-toast5';

// in CommonJS
const toast = require('vue-toast5');

// in Global variable
const toast = VueToast.default;

Vue.use(toast);
this.$toast('toast-无参数');
this.$toast('toast-对象参数',{duration:2000});
Vue.toast('toast-回调函数',function(){
    alert('回调函数');
});

Params

ParameterTypeDefaultDescription
idstringthe toast's id
msgstringthe message showed in toast
callbackfunctionthe callback function after toast hide
parentstringbodythe parent element to insert toast element
classNamestring, arraya custom class for toast
horizontalPositionstringcenterPosition horizontal of toast. There are 3 pre-defined positions: center,left,right
verticalPositionstringmiddlePosition vertical of toast. There are 3 pre-defined positions: middle,top,bottom
durationnumber2000how long time the toast show,unit is milliscond
modestringoverrideoverride or queue. If override, the last toast will forcibly flush previous
transitionstringfadeBuilt-in transitions: fade, slide-[up/down/left/right]. See also Transitions

methods

  • Vue.clearToast([id]):remove all toast or special toast by id

Preview

toast image

0.1.1

6 years ago

0.1.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago