Skip to content

Commit 37ed264

Browse files
committed
perf: 默认固定头部
1 parent 711ad0e commit 37ed264

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

ruoyi-fastapi-frontend/src/layout/components/AppMain.vue

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,39 @@ export default {
8080
min-height: 0px;
8181
}
8282
}
83+
84+
/* 移动端fixed-header优化 */
85+
@media screen and (max-width: 991px) {
86+
.fixed-header + .app-main {
87+
padding-bottom: max(60px, calc(constant(safe-area-inset-bottom) + 40px));
88+
padding-bottom: max(60px, calc(env(safe-area-inset-bottom) + 40px));
89+
overscroll-behavior-y: none;
90+
}
91+
92+
.hasTagsView .fixed-header + .app-main {
93+
padding-bottom: max(60px, calc(constant(safe-area-inset-bottom) + 40px));
94+
padding-bottom: max(60px, calc(env(safe-area-inset-bottom) + 40px));
95+
overscroll-behavior-y: none;
96+
}
97+
}
98+
99+
@supports (-webkit-touch-callout: none) {
100+
@media screen and (max-width: 991px) {
101+
.fixed-header + .app-main {
102+
padding-bottom: max(17px, calc(constant(safe-area-inset-bottom) + 10px));
103+
padding-bottom: max(17px, calc(env(safe-area-inset-bottom) + 10px));
104+
height: calc(100svh - 50px);
105+
height: calc(100dvh - 50px);
106+
}
107+
108+
.hasTagsView .fixed-header + .app-main {
109+
padding-bottom: max(17px, calc(constant(safe-area-inset-bottom) + 10px));
110+
padding-bottom: max(17px, calc(env(safe-area-inset-bottom) + 10px));
111+
height: calc(100svh - 84px);
112+
height: calc(100dvh - 84px);
113+
}
114+
}
115+
}
83116
</style>
84117

85118
<style lang="scss">

ruoyi-fastapi-frontend/src/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
/**
3333
* 是否固定头部
3434
*/
35-
fixedHeader: false,
35+
fixedHeader: true,
3636

3737
/**
3838
* 是否显示logo

0 commit comments

Comments
 (0)