mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
🌱 添加 wiki 窗口创建逻辑
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file utils/TGWindow.ts
|
||||
* @description 窗口创建相关工具函数
|
||||
* @since Beta v0.3.7
|
||||
* @since Beta v0.3.8
|
||||
*/
|
||||
|
||||
import { invoke, window as TauriWindow } from "@tauri-apps/api";
|
||||
@@ -118,3 +118,17 @@ export function createAnno(item: TGApp.App.Announcement.ListCard): void {
|
||||
}
|
||||
createTGWindow(annoPath, "Sub_window", annoTitle, 960, 720, false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 打开 Wiki
|
||||
* @since Beta v0.3.8
|
||||
* @param {string} dir 目录
|
||||
* @param {string} name 文件名
|
||||
* @returns {void}
|
||||
*/
|
||||
export function createWiki(dir: string, name: string): void {
|
||||
// if(dir !== "Character") return;
|
||||
const dirName = dir === "GCG" ? dir : dir.toLowerCase();
|
||||
const wikiPath = `/wiki/detail/${dirName}/${name}`;
|
||||
createTGWindow(wikiPath, "Sub_window", `Wiki_${dirName}_${name}`, 960, 720, false, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user