npm.io
1.3.7-alpha.1 • Published 2 years ago

@gaopeng123/message

Licence
MIT
Version
1.3.7-alpha.1
Deps
0
Size
59 kB
Vulns
0
Weekly
0
Stars
2

message

消息信息

Usage

import {initMsg} from@gaopeng123/message”;

// 初始化message 避免全局变量
const message = initMsg();

// 全局设置message的属性
message.config = {

};

type MsgConfig = {
    type?: 'info' | 'warning' | 'success' | 'error' | 'loading',
    showClose?: boolean,
    timeout?: number,
    animation?: boolean,
    autoClose?: boolean,
    content?: string,
    onClose?: any,
    maxNums?: number,
    html?: string;
};

// API
message.info('', config as MsgConfig);
message.warning('', config as MsgConfig);
message.success('', config as MsgConfig);
message.error('', config as MsgConfig);
message.loading('', config as MsgConfig);