mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
fix(title): window.appWindow.setTitle
This commit is contained in:
@@ -30,7 +30,7 @@ import { onMounted, ref } from "vue";
|
||||
import TSidebar from "./components/t-sidebar.vue";
|
||||
import TBackTop from "./components/t-backTop.vue";
|
||||
// tauri
|
||||
import { fs, window } from "@tauri-apps/api";
|
||||
import { fs, window, app } from "@tauri-apps/api";
|
||||
// store
|
||||
import useAppStore from "./store/modules/app";
|
||||
// utils
|
||||
@@ -46,6 +46,8 @@ onMounted(async () => {
|
||||
const win = await window.getCurrent();
|
||||
isMain.value = win.label === "tauri-genshin";
|
||||
if (isMain.value) {
|
||||
const title = "Tauri.Genshin v" + (await app.getVersion()) + " Alpha";
|
||||
await win.setTitle(title);
|
||||
await checkLoad();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import TLoading from "../components/t-loading.vue";
|
||||
// tauri
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
// plugins
|
||||
import MysOper from "../plugins/Mys";
|
||||
|
||||
@@ -26,6 +28,7 @@ onMounted(async () => {
|
||||
if (!post_id) {
|
||||
loadingEmpty.value = true;
|
||||
loadingTitle.value = "未找到数据";
|
||||
await appWindow.setTitle("未找到数据");
|
||||
return;
|
||||
}
|
||||
// 获取数据
|
||||
@@ -34,9 +37,11 @@ onMounted(async () => {
|
||||
const postData = await MysOper.Post.get(post_id);
|
||||
loadingTitle.value = "正在渲染数据...";
|
||||
postHtml.value = MysOper.Post.parser(postData);
|
||||
await appWindow.setTitle(postData.post.subject);
|
||||
} catch (error) {
|
||||
loadingEmpty.value = true;
|
||||
loadingTitle.value = "帖子不存在或解析失败";
|
||||
await appWindow.setTitle("帖子不存在或解析失败");
|
||||
return;
|
||||
}
|
||||
setInterval(() => {
|
||||
|
||||
Reference in New Issue
Block a user