Files
datahub/frontend/src/components/Brand.vue
T

57 lines
1.2 KiB
Vue
Raw Normal View History

2026-03-18 13:53:36 +08:00
<script setup lang="ts">
2025-11-10 13:59:55 +08:00
import logoImg from '@/assets/logo.png'
2026-03-18 13:53:36 +08:00
type Size = 'small' | 'medium' | 'large'
withDefaults(defineProps<{
size?: Size
showAppName?: boolean
showSlogan?: boolean
}>(), {
size: 'medium',
showAppName: false,
showSlogan: false,
2025-11-10 13:59:55 +08:00
})
2026-03-18 13:53:36 +08:00
const sizeClasses: Record<Size, string> = {
2025-11-10 13:59:55 +08:00
small: 'h-8',
medium: 'h-12',
large: 'h-16',
}
2026-03-18 13:53:36 +08:00
const textSizeClasses: Record<Size, string> = {
2025-11-10 13:59:55 +08:00
small: 'text-xl',
medium: 'text-2xl',
large: 'text-3xl',
}
2026-03-18 13:53:36 +08:00
const sloganSizeClasses: Record<Size, string> = {
2025-11-10 13:59:55 +08:00
small: 'text-xs',
medium: 'text-sm',
large: 'text-base',
}
</script>
<template>
<div class="flex items-center gap-3">
2026-02-28 10:38:33 +08:00
<img :src="logoImg" alt="DataHub Logo" :class="['object-contain', sizeClasses[size]]" />
2025-11-10 13:59:55 +08:00
<div v-if="showAppName || showSlogan" class="flex flex-col">
<span
v-if="showAppName"
class="text-[#4da30d] font-bold leading-tight"
:class="textSizeClasses[size]"
>
2026-02-28 10:38:33 +08:00
DataHub
2025-11-10 13:59:55 +08:00
</span>
<span
v-if="showSlogan"
class="text-gray-600 leading-tight"
:class="sloganSizeClasses[size]"
>
数据管理平台
</span>
</div>
</div>
</template>