add tiptap

This commit is contained in:
Timi
2026-08-21 01:11:23 +08:00
parent 763783b984
commit 68d9946b70
41 changed files with 5845 additions and 35 deletions
+27
View File
@@ -0,0 +1,27 @@
import type { AppContext } from "vue";
type MessageType = "info" | "success" | "warning" | "error";
type MessageHandler = (content: string) => unknown | Promise<unknown>;
type MessageApi = {
[type in MessageType]?: MessageHandler;
};
export const showTDesignMessage = async (
appContext: AppContext | undefined,
type: MessageType,
content: string
) => {
const handler = (appContext?.config.globalProperties.$message as MessageApi | undefined)?.[type];
if (handler) {
await handler(content);
return;
}
if ("error" === type) {
console.error(content);
return;
}
console.warn(content);
};