zhengyiming
2025-03-13 d580f043716d30f9617ed7f3f49a7e80d54b9865
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<template>
  <div
    :class="[
      'navigation-bar-wrapper',
      { active: props.mode === 'dark', plain: props.plain, hasBorder: props.hasBorder },
    ]"
  >
    <slot></slot>
  </div>
</template>
 
<script setup lang="ts">
import { navigationBarProps } from './navBar';
import { CSSProperties } from 'vue';
import { useAppStore } from '@/store/modules/app';
 
defineOptions({
  name: 'NavBar',
});
 
const props = defineProps(navigationBarProps);
 
const appStore = useAppStore();
 
// const barStyle = computed(
//   () =>
//     ({
//       paddingTop: appStore.statusBarHeight / 2 + 'px',
//     } as CSSProperties)
// );
</script>
 
<style lang="scss" scoped>
@use '@/style/common.scss' as *;
 
.navigation-bar-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  padding-top: constant(safe-area-inset-top);
  padding-top: env(safe-area-inset-top);
  background-color: #ffffff;
 
  &.plain {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
  }
 
  &.active {
    background-color: getCssVar('color', 'primary');
  }
 
  &.hasBorder {
    border-bottom: 1px solid #f6f6f6;
  }
}
</style>