vuejs-toasts

1.0.4 • Public • Published

Installation

npm i vuejs-toasts --save

Usage

//main.js
import Toast from 'vuejs-toasts';
Vue.use(Toast);

//.vue files
/*show component*/
this.$toast.show({text: 'hello world'});
/*close component*/
this.$toast.close();

Preview

this.$toast.show({
    text: 'hello world!',
    type: 'info'
});

vuejs-toasts

Option

use option to custom the component. option is an object. Use option in the following ways:

  • Set option once.
this.$toast.show(option);
  • Set option globally, the next time you show the component, option would still be effective.
Vue.use(Toast, option);

option available:

key type default description
text string toast text
type string "normal" type of toast, can be "normal", "success", "fail" or "info"
mask boolean true whether to show a fullscreen,transparent mask
callback function function to call when toast is closed
duration number 2000 auto close time, 1000 = 1 second;

License

The MIT License

Readme

Keywords

Package Sidebar

Install

npm i vuejs-toasts

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

15.8 kB

Total Files

4

Last publish

Collaborators

  • fengjiejun