vue-toast
a modified version from vue-easytoast
Install
npm install vue-toast5 -S yarn add vue-toast5
QuickStart
; // in ES6 modules; // in CommonJSconst toast = ; // in Global variableconst toast = VueToastdefault; Vue;
this;this;Vue;
Params
Parameter | Type | Default | Description |
---|---|---|---|
id | string |
the toast's id | |
msg | string |
the message showed in toast | |
callback | function |
the callback function after toast hide | |
parent | string |
body |
the parent element to insert toast element |
className | string , array |
a custom class for toast | |
horizontalPosition | string |
center |
Position horizontal of toast. There are 3 pre-defined positions: center ,left ,right |
verticalPosition | string |
middle |
Position vertical of toast. There are 3 pre-defined positions: middle ,top ,bottom |
duration | number |
2000 | how long time the toast show,unit is milliscond |
mode | string |
override |
override or queue . If override , the last toast will forcibly flush previous |
transition | string |
fade |
Built-in transitions: fade , slide-[up/down/left/right] . See also Transitions |
methods
Vue.clearToast([id])
:remove all toast or special toast by id