Skip to content

Commit

Permalink
优化网页加载速度;优化移动端高度
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Sep 4, 2023
1 parent dc334d4 commit ca6906d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,21 @@ function start() {
axios.get(`${import.meta.env.VITE_HTTP_URL}/start`)
}
function set_window_height() {
const vh = window.innerHeight * 0.01
document.documentElement.style.setProperty('--vh', `${vh}px`)
}
onMounted(async () => {
set_window_height()
window.addEventListener('resize', () => {
set_window_height()
})
const params = new URLSearchParams(document.location.search)
const token = params.get('token')
axios.defaults.headers.common['token'] = token
await load_config()
await load_shop()
await load_plan()
await load_operators()
await get_running()
await Promise.all([load_config(), load_shop(), load_plan(), load_operators(), get_running()])
if (!ws.value) {
listen_ws()
Expand All @@ -97,7 +103,7 @@ onMounted(async () => {
<style>
#app {
height: 100vh;
height: calc(var(--vh, 1vh) * 100);
}
.n-tab-pane {
Expand Down

0 comments on commit ca6906d

Please sign in to comment.