|
@@ -1,6 +1,6 @@
|
|
|
import { FormItem, Pen, Meta2d, Meta2dData } from "@meta2d/core";
|
|
|
-import { MessagePlugin, NotifyPlugin } from "tdesign-vue-next";
|
|
|
-import { ref } from "vue";
|
|
|
+import { MessagePlugin, NotifyPlugin, Button } from "tdesign-vue-next";
|
|
|
+import { h, ref } from "vue";
|
|
|
import { cdn } from "./api";
|
|
|
|
|
|
const market = import.meta.env.VITE_MARKET;
|
|
@@ -39,21 +39,35 @@ export interface Meta2dBackData extends Meta2dData {
|
|
|
const notification = ref<any>(null);
|
|
|
export function showNotification(title: string): Promise<boolean> {
|
|
|
return new Promise<boolean>((resolve) => {
|
|
|
+ const btnClick = () => {
|
|
|
+ NotifyPlugin.close(notification.value);
|
|
|
+ notification.value = null;
|
|
|
+ resolve(true);
|
|
|
+ };
|
|
|
if (!notification.value) {
|
|
|
notification.value = NotifyPlugin.info({
|
|
|
title: "提示",
|
|
|
content: title,
|
|
|
- closeBtn: "确定",
|
|
|
+ closeBtn: true,
|
|
|
onCloseBtnClick: () => {
|
|
|
//关闭按钮
|
|
|
- NotifyPlugin.close(notification.value);
|
|
|
notification.value = null;
|
|
|
- resolve(true);
|
|
|
- },
|
|
|
- onDurationEnd: () => {
|
|
|
- //计时结束
|
|
|
resolve(false);
|
|
|
},
|
|
|
+ duration: 1000000,
|
|
|
+ footer: h(
|
|
|
+ Button,
|
|
|
+ {
|
|
|
+ theme: "primary",
|
|
|
+ size: "small",
|
|
|
+ style: {
|
|
|
+ "margin-top": "16px",
|
|
|
+ "margin-left": "256px",
|
|
|
+ },
|
|
|
+ onClick: btnClick,
|
|
|
+ },
|
|
|
+ "确定"
|
|
|
+ ),
|
|
|
});
|
|
|
}
|
|
|
});
|