From 635ac250f44b236a8c17b663a2e552b34e381cc4 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 18 Apr 2022 14:56:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=20=20toast=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E4=BC=A0level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/foundation/message.js | 1 + typescript/base/foundation/message.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base/foundation/message.js b/src/base/foundation/message.js index 860449ab4..156297c9d 100644 --- a/src/base/foundation/message.js +++ b/src/base/foundation/message.js @@ -22,6 +22,7 @@ BI.Msg = function () { // BI.Msg.prompt(title, message, value, callback, min_width); }, toast: function (message, options, context) { + BI.isString(options) && (options = { level: options }) options = options || {}; context = context || BI.Widget._renderEngine.createElement("body"); var level = options.level || "common"; diff --git a/typescript/base/foundation/message.ts b/typescript/base/foundation/message.ts index ce7d54c3a..63790d1cb 100644 --- a/typescript/base/foundation/message.ts +++ b/typescript/base/foundation/message.ts @@ -2,5 +2,5 @@ export type _msg = { alert: (title: string, message?: string | {[key: string]: any}, callback?: (result?: boolean)=>void) => void confirm: (title: string, message?: string | {[key: string]: any}, callback?: (result: boolean)=>void) => void prompt: (title: string, message?: string, value?: any, callback?: (result: string) => void, minWidth?: number) => void - toast: (message: string, options?: object, context?: HTMLElement) => void + toast: (message: string, options?: object | string, context?: HTMLElement) => void }