This commit is contained in:
Lexcubia 2025-04-21 11:23:59 +08:00
parent a7fc7b8007
commit 34926c7270
4 changed files with 13 additions and 5 deletions

View File

@ -44,7 +44,6 @@
"marked": "^15.0.8", "marked": "^15.0.8",
"pinia": "^3.0.2", "pinia": "^3.0.2",
"pinia-plugin-persistedstate": "^4.2.0", "pinia-plugin-persistedstate": "^4.2.0",
"vh-check": "^2.0.5",
"vue": "^3.5.13", "vue": "^3.5.13",
"vue-router": "^4.5.0" "vue-router": "^4.5.0"
}, },

View File

@ -1,5 +1,16 @@
<script setup> <script setup>
import { RouterView } from "vue-router"; import { RouterView } from "vue-router";
onMounted(() => {
window.addEventListener("resize", ()=>{
heightTemp.value = (window.innerHeight)+"px";
document.getElementById("app").style.height = heightTemp.value;
});
window.addEventListener("DOMContentLoaded", ()=>{
heightTemp.value = (window.innerHeight)+"px";
document.getElementById("app").style.height = heightTemp.value;
});
})
</script> </script>
<template> <template>

View File

@ -15,7 +15,7 @@ import Sidebar from '../components/Sidebar.vue'
<style scoped> <style scoped>
.main-layout { .main-layout {
display: flex; display: flex;
height: calc(100vh - var(--vh-offset, 0px)); height: 100vh;
/* min-width: 640px; */ /* min-width: 640px; */
overflow: hidden; /* 防止内部滚动影响布局 */ overflow: hidden; /* 防止内部滚动影响布局 */
} }

View File

@ -4,7 +4,6 @@ import App from "./App.vue";
import {router} from "@/router/index"; import {router} from "@/router/index";
import { createPinia } from "pinia"; import { createPinia } from "pinia";
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import vhCheck from 'vh-check'
// 引入 Element Plus // 引入 Element Plus
import ElementPlus from 'element-plus' import ElementPlus from 'element-plus'
@ -21,5 +20,4 @@ app.use(router);
app.use(ElementPlus, { app.use(ElementPlus, {
locale: zhCn, locale: zhCn,
}) })
app.mount("#app"); app.mount("#app");
vhCheck()