gaoluyang
2026-06-24 712aa51536236d43e87273e4ce45ac5691dffad8
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
68
69
70
71
72
<script setup lang="ts">
import type { TitleBarProperty } from './config';
 
import { IconifyIcon } from '..\..\..\..\..\..\..\..\packages\icons\src';
 
import { Image } from 'ant-design-vue';
 
/** 标题栏 */
defineOptions({ name: 'TitleBar' });
 
defineProps<{ property: TitleBarProperty }>();
</script>
<template>
  <div
    class="relative box-border min-h-[20px] w-full"
    :style="{ height: `${property.height}px` }"
  >
    <Image
      v-if="property.bgImgUrl"
      :src="property.bgImgUrl"
      :preview="false"
      class="w-full object-cover"
    />
    <div
      class="absolute left-0 top-0 flex h-full w-full flex-col justify-center"
    >
      <!-- 标题 -->
      <div
        :style="{
          fontSize: `${property.titleSize}px`,
          fontWeight: property.titleWeight,
          color: property.titleColor,
          textAlign: property.textAlign,
          marginLeft: `${property.marginLeft}px`,
          marginBottom: '4px',
        }"
        v-if="property.title"
      >
        {{ property.title }}
      </div>
      <!-- 副标题 -->
      <div
        :style="{
          fontSize: `${property.descriptionSize}px`,
          fontWeight: property.descriptionWeight,
          color: property.descriptionColor,
          textAlign: property.textAlign,
          marginLeft: `${property.marginLeft}px`,
        }"
        v-if="property.description"
      >
        {{ property.description }}
      </div>
    </div>
    <!-- 更多 -->
    <div
      class="absolute bottom-0 right-2 top-0 m-auto flex items-center justify-center text-[10px] text-[#969799]"
      v-show="property.more.show"
      :style="{
        color: property.descriptionColor,
      }"
    >
      <span v-if="property.more.type !== 'icon'">
        {{ property.more.text }}
      </span>
      <IconifyIcon
        icon="lucide:arrow-right"
        v-if="property.more.type !== 'text'"
      />
    </div>
  </div>
</template>