zhengyiming
2025-02-20 e51dc0193b5945ef116e71a811cdc5681ae56556
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
58
<template>
  <div
    :class="[
      'navigation-bar-wrapper',
      { active: props.mode === 'dark', plain: props.plain, hasBorder: props.hasBorder },
    ]"
    :style="barStyle"
  >
    <slot></slot>
  </div>
</template>
 
<script setup lang="ts">
import { CSSProperties } from 'vue';
import { useSystemStore } from '@/stores/modules/system';
import { navigationBarProps } from './navBar';
 
defineOptions({
  name: 'NavBar',
});
 
const props = defineProps(navigationBarProps);
 
const systemStore = useSystemStore();
 
const barStyle = computed(
  () =>
    ({
      paddingTop: systemStore.info.statusBarHeight + 'px',
      // height: systemStore.navigationBarHeight + 'px',
    } as CSSProperties)
);
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.navigation-bar-wrapper {
  background-color: #fff;
  display: flex;
  position: relative;
  // box-shadow: 0px 1px 7px 0px rgb(237, 238, 241);
  z-index: 10;
 
  &.plain {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
  }
 
  &.active {
    background-color: boleGetCssVar('color', 'primary');
  }
 
  &.hasBorder {
    border-bottom: 1px solid #f6f6f6;
  }
}
</style>