A simple, lightweight notification plugin
npm install maya-notice --save
quick use
import notice from "maya-notice";
import "maya-notice/src/style.css";
notice.info("hello world");
notice.success("hello world");
notice.warning("hello world");
notice.error("hello world");
notice.loading("Loading...please wait");
Use more options
notice.open({
type : 'error',
content : 'hi how are you',
duration : 5000,
maskable : true,
onClose : function(){
alert('closed');
}
});
notice.close();
execute callback function after closing
notice.loading("Loading...",{
onClose:function(){
alert('closed');
}
});
Properties | Type | Default | Description |
---|---|---|---|
content | String | "" | Content string |
type | String | "info" | Optional values are:info,success,error,warning,loading |
duration | Number | 2500 | Display duration |
maskable | Boolean | false | Whether to display the background mask layer |
onClose | Function | function(){} | Callback function after closing |