Files
xerrors--yuxi/web/src/components/HeaderComponent.vue
T
wehub-resource-sync 1443d3fdf9
Ruff Format Check / Ruff Format & Lint (push) Failing after 7m39s
Deploy VitePress site to Pages / build (push) Failing after 9m11s
Deploy VitePress site to Pages / Deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:32:26 +08:00

91 lines
1.6 KiB
Vue

<template>
<div class="header-container">
<div class="header-content">
<div class="header-actions" v-if="$slots.left">
<slot name="left"></slot>
</div>
<div class="header-title">
<div class="header-title-block">
<h1>{{ title }}</h1>
<slot name="behind-title"></slot>
</div>
<slot name="description">
<p v-if="description">{{ description }}</p>
</slot>
</div>
<div class="header-actions" v-if="$slots.actions">
<loading-outlined v-if="loading" />
<slot name="actions"></slot>
</div>
</div>
</div>
</template>
<script setup>
import { LoadingOutlined } from '@ant-design/icons-vue'
defineProps({
title: {
type: String,
required: true
},
description: {
type: String,
default: ''
},
loading: {
type: Boolean,
default: false
}
})
</script>
<style scoped lang="less">
.header-container {
background-color: var(--bg-sider);
backdrop-filter: blur(10px);
padding: 8px var(--page-padding);
height: 50px;
position: sticky;
top: 0;
z-index: 1000;
}
.header-content {
display: flex;
width: 100%;
height: 100%;
justify-content: space-between;
align-items: center;
gap: 10px;
}
.header-title {
flex: 1;
width: 100%;
font-size: 14px;
color: var(--gray-900);
.header-title-block {
display: flex;
align-items: baseline;
gap: 10px;
}
h1 {
margin: 0;
font-size: 16px;
font-weight: 500;
color: var(--gray-2000);
}
p {
margin: 4px 0 0;
}
}
.header-actions {
display: flex;
gap: 8px;
}
</style>