♻️ 感觉差不多了,剩下的就靠测试了 #92

This commit is contained in:
目棃
2024-07-03 22:33:00 +08:00
parent 8a2c7d13c6
commit f4de7552e1
28 changed files with 249 additions and 399 deletions

View File

@@ -6,8 +6,7 @@
</transition>
</template>
<script lang="ts" setup>
// vue
import { ref, onMounted } from "vue";
import { ref, onMounted, onUnmounted } from "vue";
const scrollTop = ref(0); // 滚动条距离顶部的距离
const canTop = ref(false); // 默认不显示
@@ -45,6 +44,11 @@ function handleScrollTop(): void {
onMounted(() => {
window.addEventListener("scroll", handleScroll);
});
// 销毁监听
onUnmounted(() => {
window.removeEventListener("scroll", handleScroll);
});
</script>
<style scoped>

View File

@@ -242,7 +242,7 @@
</template>
<script lang="ts" setup>
import { event, window as TauriWindow } from "@tauri-apps/api";
import { event, webviewWindow } from "@tauri-apps/api";
import { UnlistenFn, Event } from "@tauri-apps/api/event";
import { storeToRefs } from "pinia";
import { computed, onMounted, onUnmounted, ref, watch } from "vue";
@@ -302,7 +302,7 @@ onMounted(async () => {
const theme = e.payload;
themeGet.value = theme === "default" ? "default" : "dark";
});
if (TauriWindow.getCurrent().label === "TeyvatGuide") {
if (webviewWindow.getCurrent().label === "TeyvatGuide") {
await mhyClient.run();
}
if (userStore.briefInfo.value && userStore.briefInfo.value.nickname) {