Browse Source

BI-137665 fix: 代码优化

research/test
jian 9 months ago
parent
commit
ea52d833b8
  1. 19
      packages/fineui/src/base/foundation/message.js
  2. 2
      packages/fineui/typescript/base/foundation/message.ts

19
packages/fineui/src/base/foundation/message.js

@ -21,27 +21,23 @@ import {
} from "../../core"; } from "../../core";
import { Toast } from "../single"; import { Toast } from "../single";
export const Msg = (() => { let $mask, $pop;
let $mask, $pop;
const messageShows = []; const messageShows = [];
const toastStack = []; const toastStack = [];
const defaultConfig = { const defaultConfig = {
buttonHeight: 24, buttonHeight: 24,
}; };
return { export const Msg = {
alert(title, message, callback, config = defaultConfig) { alert(title, message, callback, config = defaultConfig) {
this._show(false, title, message, callback, config); this._show(false, title, message, callback, config);
}, },
confirm(title, message, callback, config = defaultConfig) { confirm(title, message, callback, config = defaultConfig) {
this._show(true, title, message, callback, config); this._show(true, title, message, callback, config);
}, },
prompt(title, message, value, callback, min_width) {
// Msg.prompt(title, message, value, callback, min_width);
},
toast(message, options, context) { toast(message, options, context) {
isString(options) && (options = { level: options }); isString(options) && (options = { level: options });
options = options || {}; options = options || {};
@ -270,5 +266,4 @@ export const Msg = (() => {
messageShows[messageShows.length] = createWidget(conf); messageShows[messageShows.length] = createWidget(conf);
}, },
}; };
})();

2
packages/fineui/typescript/base/foundation/message.ts

@ -14,7 +14,5 @@ export declare namespace Msg {
[key: string]: any [key: string]: any
}, callback?: (result: boolean) => void): void }, callback?: (result: boolean) => void): void
function prompt(title: string, message?: string, value?: any, callback?: (result: string) => void, minWidth?: number): void
function toast(message: string | Obj, options?: toastOptions | string, context?: HTMLElement): Function function toast(message: string | Obj, options?: toastOptions | string, context?: HTMLElement): Function
} }

Loading…
Cancel
Save