Skip to content

tongwoo/maya-notice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

maya-notice

A simple, lightweight notification plugin

install

npm install maya-notice --save

usage

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');
    }
});

options

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

About

A simple, lightweight notification plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published