Skip to content

Message 消息提示类 ​

  • Globe 对象上已经挂载了 Message

方法 ​

run ​

typescript
run(params: MessageParm | string): Promise<"success" | "loading">

type MessageParm = {
  message: string; //消息内容
  type: 'error' | 'success' | 'warning' | 'info' | 'loading';
  duration?: number; //消息持续时间,为0时消息不会消失,通过key更新状态
  key?: string; //消息key标识,用来更新消息
};

info 提示 ​

typescript
info(message: string, duration?: number, key?: string): Promise<"loading" | "success">

success 成功 ​

typescript
success(message: string, duration?: number, key?: string): Promise<"loading" | "success">

error 错误 ​

typescript
error(message: string, duration?: number, key?: string): Promise<"loading" | "success">

warning 警告 ​

typescript
warning(message: string, duration?: number, key?: string): Promise<"loading" | "success">

loading 等待 ​

typescript
loading(message: string, duration?: number, key?: string): Promise<"loading" | "success">

destroy 销毁 ​

typescript
destroy(): void