index.vue
1.66 KB
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
59
60
61
62
63
64
65
66
67
<template>
<n-layout-header bordered class="go-header">
<header class="go-header-box" :class="{ 'is-project': isProject }">
<div class="header-item left">
<n-space>
<slot name="left"></slot>
</n-space>
</div>
<div class="header-item center">
<slot name="center"></slot>
</div>
<div class="header-item right">
<n-space>
<slot name="ri-left"> </slot>
<go-lang-select></go-lang-select>
<theme-color-select></theme-color-select>
<go-theme-select></go-theme-select>
<slot name="ri-right"> </slot>
</n-space>
</div>
</header>
</n-layout-header>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import { GoThemeSelect } from '@/components/GoThemeSelect'
import { GoLangSelect } from '@/components/GoLangSelect'
import { ThemeColorSelect } from '@/components/Pages/ThemeColorSelect'
import { PageEnum } from '@/enums/pageEnum'
const route = useRoute()
const isProject = computed(() => {
return route.fullPath === PageEnum.BASE_HOME_ITEMS
})
</script>
<style lang="scss" scoped>
$min-width: 520px;
@include go(header) {
&-box {
display: grid;
grid-template-columns: repeat(3, 33%);
&.is-project {
grid-template-columns: none;
}
.header-item {
display: flex;
align-items: center;
min-width: $min-width;
&.left {
justify-content: start;
}
&.center {
justify-content: center;
}
&.right {
justify-content: end;
}
}
height: $--header-height;
padding: 0 20px 0 60px;
}
}
</style>