修复模型库提示弹窗调用
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { w2alert, w2confirm, w2popup } from "../vendor/w2ui";
|
||||
import { w2confirm, w2popup, w2utils } from "../vendor/w2ui";
|
||||
|
||||
type PopupActionEvent = {
|
||||
detail: {
|
||||
@@ -10,7 +10,11 @@ type PopupActionEvent = {
|
||||
};
|
||||
|
||||
export function notify(message: string, title = "提示") {
|
||||
w2alert(message, title);
|
||||
w2utils.alert({
|
||||
box: "body",
|
||||
title,
|
||||
text: message
|
||||
});
|
||||
}
|
||||
|
||||
export function notifyError(error: unknown) {
|
||||
|
||||
9
web/src/vendor/w2ui.ts
vendored
9
web/src/vendor/w2ui.ts
vendored
@@ -21,6 +21,14 @@ type W2Popup = {
|
||||
close(): void;
|
||||
};
|
||||
|
||||
type W2Utils = {
|
||||
alert(options: {
|
||||
box?: string | HTMLElement;
|
||||
title?: string;
|
||||
text?: string;
|
||||
}): unknown;
|
||||
};
|
||||
|
||||
type W2LayoutOptions = {
|
||||
name: string;
|
||||
padding?: number;
|
||||
@@ -45,6 +53,7 @@ const local = w2uiLocal as Record<string, unknown>;
|
||||
export const w2popup = local.w2popup as W2Popup;
|
||||
export const w2layout = local.w2layout as new (options: W2LayoutOptions) => W2Layout;
|
||||
export const w2ui = local.w2ui as Record<string, { destroy?: () => void } | undefined>;
|
||||
export const w2utils = local.w2utils as W2Utils;
|
||||
export const w2alert = local.w2alert as (message: string, title?: string) => unknown;
|
||||
export const w2confirm = local.w2confirm as (
|
||||
message: string | { msg: string; title?: string; yes?: string; no?: string },
|
||||
|
||||
Reference in New Issue
Block a user