mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
♻️ 感觉差不多了,剩下的就靠测试了 #92
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user