🔊 完善用户页面的 log,其他的再说吧

close #83
This commit is contained in:
目棃
2024-01-23 19:48:18 +08:00
parent 8aaf18dbe2
commit 3ee9bf74f1
7 changed files with 160 additions and 52 deletions

View File

@@ -104,7 +104,7 @@
<script lang="ts" setup>
import { dialog, fs, path } from "@tauri-apps/api";
import { computed, nextTick, onBeforeMount, onMounted, ref } from "vue";
import { computed, nextTick, onMounted, ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import showConfirm from "../../components/func/confirm";

View File

@@ -62,8 +62,6 @@ function readLoading(): void {
}
onMounted(async () => {
const items = showHome.value.join("、");
await TGLogger.Info(`[Home][onMounted] 打开首页,当前显示:${items}`);
loadingTitle.value = "正在加载首页";
const isProdEnv = import.meta.env.MODE === "production";
// 获取当前环境
@@ -85,6 +83,8 @@ onMounted(async () => {
}),
);
timer.value = setInterval(readLoading, 100);
const items = showHome.value.join("、");
await TGLogger.Info(`[Home][onMounted] 打开首页,当前显示:${items}`);
});
async function submitHome(): Promise<void> {
@@ -109,9 +109,8 @@ async function submitHome(): Promise<void> {
}
// 监听定时器
onUpdated(() => {
onUpdated(async () => {
if (!loading.value && timer.value !== null) {
TGLogger.Info("[Home][onMounted] 首页加载完成");
clearInterval(timer.value);
timer.value = null;
}
@@ -119,6 +118,9 @@ onUpdated(() => {
onUnmounted(() => {
itemRefs.value = [];
components.value = [];
clearInterval(timer.value);
timer.value = null;
});
</script>
<style lang="css" scoped>