Skip to content

Commit e5a56e2

Browse files
committed
修复header问题
1 parent e94592a commit e5a56e2

File tree

5 files changed

+434
-427
lines changed

5 files changed

+434
-427
lines changed

app/assets/css/global.less

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ li {
1818
font-variation-settings: 'wght' 480;
1919
letter-spacing: 0.015rem;
2020
word-spacing: 0.1rem;
21+
22+
--mdui-breakpoint-md: 767px;
23+
--mdui-breakpoint-sm: 424px;
2124
}
2225

2326
body {
@@ -65,8 +68,9 @@ pre {
6568
}
6669

6770
mdui-top-app-bar,
68-
.footer {
69-
color: var(--bar-text-color);
71+
footer {
72+
color: rgb(var(--mdui-color-on-surface-variant));
73+
background-color: rgb(var(--mdui-color-surface-variant));
7074
}
7175

7276
.body {

app/components/DefaultNav.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<ClientOnly>
3-
<mdui-top-app-bar style="position: fixed">
2+
<header class="header" style="position: fixed; top: 0; left: 0; right: 0">
3+
<mdui-top-app-bar>
44
<mdui-button-icon @click="$emit('open-drawer')">
55
<mdui-icon-menu></mdui-icon-menu>
66
</mdui-button-icon>
@@ -14,10 +14,10 @@
1414
<NavDarkChangeButton />
1515
<NavChangeWebColor />
1616
<NavShareButton />
17-
<!-- <NavMoreButton /> -->
17+
<NavMoreButton />
1818
</div>
1919
</mdui-top-app-bar>
20-
</ClientOnly>
20+
</header>
2121
</template>
2222

2323
<script lang="ts" setup>
@@ -32,11 +32,12 @@ import '@mdui/icons/share.js'
3232
</script>
3333

3434
<style scoped>
35-
mdui-top-app-bar {
35+
.header {
3636
top: 0;
3737
left: 0;
3838
right: 0;
3939
z-index: 100;
40-
background-color: rgb(var(--mdui-color-surface-variant));
40+
position: fixed;
41+
height: 64px;
4142
}
4243
</style>

app/components/navigation-drawer/List.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ const list = data.value[0].meta.body
2020
</script>
2121

2222
<style scoped>
23+
mdui-list {
24+
padding-top: 64px;
25+
}
26+
2327
mdui-list-item {
2428
padding-left: 4px;
2529
}

app/layouts/Default.vue

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
<DefaultNav @open-drawer="toggleDrawer">
44
<template #topic-text><slot name="topic-text" /></template>
55
</DefaultNav>
6-
<mdui-navigation-drawer
7-
modal
8-
close-on-overlay-click
9-
close-on-esc
10-
:open="drawerStatus"
11-
@close="drawerStatus = false"
12-
>
13-
<NavigationDrawerList />
14-
</mdui-navigation-drawer>
6+
<aside>
7+
<mdui-navigation-drawer
8+
modal
9+
close-on-overlay-click
10+
close-on-esc
11+
:open="drawerStatus"
12+
@close="drawerStatus = false"
13+
>
14+
<NavigationDrawerList />
15+
</mdui-navigation-drawer>
16+
</aside>
1517
<mdui-layout-main>
1618
<slot name="full-width"></slot>
1719
<AppContainer>
@@ -37,26 +39,21 @@ useHead({
3739
},
3840
],
3941
})
40-
41-
useSeoMeta({
42-
ogImage: '/__og-image__/static/og.png',
43-
})
4442
</script>
4543

4644
<style lang="less" scoped>
4745
mdui-layout {
4846
scroll-behavior: smooth;
4947
min-width: 320px;
50-
overflow: hidden;
51-
position: relative;
5248
}
5349
// top-app-bar 的 z-index 值为100
5450
// navigation-drawer 的 z-index 值为99
51+
52+
aside {
53+
z-index: 99;
54+
}
55+
5556
mdui-navigation-drawer {
5657
--shape-corner: 0px;
57-
--z-index: 99;
58-
mdui-list {
59-
padding-top: 64px;
60-
}
6158
}
6259
</style>

0 commit comments

Comments
 (0)