vuejs-alert

1.1.8 • Public • Published

Installation

npm i vuejs-alert --save

Usage

//main.js
import Alert from 'vuejs-alert';
Vue.use(Alert);

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

Preview

vuejs-alert

Option

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

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

option available:

key type default description
text string alert text
confirmText string "确定" text of confirm button
cancelText string "取消" text of cancel button
confirmCallback function function to call when confirm button is clicked
cancelCallback function function to call when cancel button is clicked
duration number auto close time, 1000 = 1 second
background string 0.5 opacity of background color, range from 0 to 1

License

The MIT License

Readme

Keywords

Package Sidebar

Install

npm i vuejs-alert

Weekly Downloads

1

Version

1.1.8

License

MIT

Unpacked Size

14 kB

Total Files

4

Last publish

Collaborators

  • fengjiejun