修复模型库提示弹窗调用

This commit is contained in:
zhangshun
2026-05-29 17:16:26 +08:00
parent b27bf2c83b
commit 35934f8088
2 changed files with 15 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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 },