68 lines
1.7 KiB
Vue
Raw Normal View History

2021-12-16 20:08:05 +08:00
<template>
2021-12-18 16:36:43 +08:00
<n-layout-header bordered class="go-header">
2023-03-04 17:31:49 +08:00
<header class="go-header-box" :class="{ 'is-project': isProject }">
<div class="header-item left">
<n-space>
<slot name="left"></slot>
</n-space>
2021-12-16 20:08:05 +08:00
</div>
<div class="header-item center">
2022-01-05 20:52:49 +08:00
<slot name="center"></slot>
</div>
<div class="header-item right">
<n-space>
2021-12-18 16:36:43 +08:00
<slot name="ri-left"> </slot>
2022-04-14 10:05:57 +08:00
<go-lang-select></go-lang-select>
<theme-color-select></theme-color-select>
2022-04-14 10:05:57 +08:00
<go-theme-select></go-theme-select>
2021-12-18 16:36:43 +08:00
<slot name="ri-right"> </slot>
</n-space>
2021-12-16 20:08:05 +08:00
</div>
</header>
2021-12-18 16:36:43 +08:00
</n-layout-header>
2021-12-16 20:08:05 +08:00
</template>
<script setup lang="ts">
2023-03-04 17:31:49 +08:00
import { computed } from 'vue'
import { useRoute } from 'vue-router'
2022-04-14 10:05:57 +08:00
import { GoThemeSelect } from '@/components/GoThemeSelect'
import { GoLangSelect } from '@/components/GoLangSelect'
import { ThemeColorSelect } from '@/components/Pages/ThemeColorSelect'
2023-03-04 17:31:49 +08:00
import { PageEnum } from '@/enums/pageEnum'
const route = useRoute()
const isProject = computed(() => {
return route.fullPath === PageEnum.BASE_HOME_ITEMS
})
2021-12-16 20:08:05 +08:00
</script>
<style lang="scss" scoped>
2023-03-03 22:25:36 +08:00
$min-width: 520px;
2021-12-16 20:08:05 +08:00
@include go(header) {
&-box {
display: grid;
2023-03-04 17:31:49 +08:00
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;
}
}
2021-12-16 20:08:05 +08:00
height: $--header-height;
2023-03-04 17:31:49 +08:00
padding: 0 20px 0 60px;
2021-12-16 20:08:05 +08:00
}
}
</style>