mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 20:29:20 +08:00
feat: 优化可两栏布局的页面都改成两栏
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { createIconifyIcon } from '@vben/icons';
|
||||
|
||||
import { Avatar } from 'ant-design-vue';
|
||||
|
||||
defineOptions({ name: 'CompanyLogoAvatar' });
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
logo?: string;
|
||||
name?: string;
|
||||
size?: number;
|
||||
}>(),
|
||||
{
|
||||
logo: undefined,
|
||||
name: undefined,
|
||||
size: 36,
|
||||
},
|
||||
);
|
||||
|
||||
const BuildingIcon = createIconifyIcon('lucide:building-2');
|
||||
|
||||
const fallbackText = computed(() => {
|
||||
const text = props.name?.trim();
|
||||
return text ? text.charAt(0).toUpperCase() : '';
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Avatar
|
||||
:size="size"
|
||||
:src="logo"
|
||||
:alt="name"
|
||||
shape="square"
|
||||
class="company-logo-avatar shrink-0 !rounded-md !bg-muted"
|
||||
>
|
||||
<span v-if="fallbackText" class="text-xs font-medium">{{ fallbackText }}</span>
|
||||
<BuildingIcon v-else class="h-4 w-4 text-muted-foreground" />
|
||||
</Avatar>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.company-logo-avatar {
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
.company-logo-avatar span {
|
||||
display: block;
|
||||
line-height: 1;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user