mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
🎨 布局调整
This commit is contained in:
34
src/App.vue
34
src/App.vue
@@ -1,20 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-layout>
|
<v-app>
|
||||||
<!-- 侧边栏菜单 -->
|
|
||||||
<TSidebar v-if="isMain" />
|
<TSidebar v-if="isMain" />
|
||||||
<!-- 主体内容 -->
|
<v-main>
|
||||||
<v-main class="app-main">
|
<v-container fluid class="app-container">
|
||||||
<v-container fluid>
|
|
||||||
<router-view />
|
<router-view />
|
||||||
</v-container>
|
</v-container>
|
||||||
</v-main>
|
</v-main>
|
||||||
</v-layout>
|
<TBackTop />
|
||||||
<TBackTop />
|
</v-app>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
// vue
|
// vue
|
||||||
import { onMounted, ref } from "vue";
|
import { onBeforeMount, onMounted, ref } from "vue";
|
||||||
import TSidebar from "./components/main/t-sidebar.vue";
|
import TSidebar from "./components/main/t-sidebar.vue";
|
||||||
import TBackTop from "./components/main/t-backTop.vue";
|
import TBackTop from "./components/main/t-backTop.vue";
|
||||||
// tauri
|
// tauri
|
||||||
@@ -23,13 +21,10 @@ import { app, event, fs, window } from "@tauri-apps/api";
|
|||||||
import { useAppStore } from "./store/modules/app";
|
import { useAppStore } from "./store/modules/app";
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const isMain = ref(true as boolean);
|
const isMain = ref(false as boolean);
|
||||||
const theme = ref(appStore.theme as string);
|
const theme = ref(appStore.theme as string);
|
||||||
|
|
||||||
onMounted(async () => {
|
onBeforeMount(async () => {
|
||||||
// 获取当前主题
|
|
||||||
document.documentElement.className = theme.value;
|
|
||||||
await listenOnTheme();
|
|
||||||
// 获取当前窗口
|
// 获取当前窗口
|
||||||
const win = window.getCurrent();
|
const win = window.getCurrent();
|
||||||
isMain.value = win.label === "tauri-genshin";
|
isMain.value = win.label === "tauri-genshin";
|
||||||
@@ -40,6 +35,12 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
// 获取当前主题
|
||||||
|
document.documentElement.className = theme.value;
|
||||||
|
await listenOnTheme();
|
||||||
|
});
|
||||||
|
|
||||||
// 监听主题变化
|
// 监听主题变化
|
||||||
async function listenOnTheme () {
|
async function listenOnTheme () {
|
||||||
await event.listen("readTheme", (e) => {
|
await event.listen("readTheme", (e) => {
|
||||||
@@ -75,9 +76,10 @@ async function createDataDir () {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="css">
|
<style lang="css">
|
||||||
.app-main {
|
.app-container {
|
||||||
min-height: 100vh;
|
padding: 0;
|
||||||
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
background: var(--page-bg);
|
background: var(--page-bg);
|
||||||
backdrop-filter: blur(20px);
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -2,13 +2,6 @@
|
|||||||
@import url("themes/default.css");
|
@import url("themes/default.css");
|
||||||
@import url("themes/dark.css");
|
@import url("themes/dark.css");
|
||||||
|
|
||||||
/*
|
|
||||||
* @description 让滚动条在内侧显示
|
|
||||||
* @since Alpha v0.1.0
|
|
||||||
*/
|
|
||||||
html {
|
|
||||||
overflow: overlay;
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* @description 侧边滚动条样式
|
* @description 侧边滚动条样式
|
||||||
* @since Alpha v0.1.3
|
* @since Alpha v0.1.3
|
||||||
|
|||||||
Reference in New Issue
Block a user