Skip to content

Commit 8384317

Browse files
committed
fix: navbar 展示bug
1 parent 30d09df commit 8384317

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"dcloudio",
4242
"qrcode",
4343
"refresherrefresh",
44+
"safeareainsets",
4445
"scrolltolower",
4546
"tabbar",
4647
"unibest",

src/pages/demo/base/navbar.vue

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@
1010
left-icon="left"
1111
@clickLeft="goBack"
1212
class="fixed w-full"
13+
:border="false"
14+
:status-bar="true"
1315
></uni-nav-bar>
14-
<view class="h-11"></view>
15-
<fly-content :line="20" />
16+
<view class="h-11" :style="{ paddingTop: safeAreaInsets?.top + 'px' }"></view>
17+
<view>
18+
<fly-content :line="20" />
19+
</view>
1620
</template>
1721

1822
<script lang="ts" setup>
1923
const goBack = () => {
2024
uni.navigateBack()
2125
}
26+
// 获取屏幕边界到安全区域距离
27+
const { safeAreaInsets } = uni.getSystemInfoSync()
2228
</script>

0 commit comments

Comments
 (0)