mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
fix(title): window.appWindow.setTitle
This commit is contained in:
@@ -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