| | |
| | | <template> |
| | | <el-scrollbar> |
| | | <div |
| | | class="bedside-auxiliary-screen-card" |
| | | :style="{ |
| | | '--bg-color': props.backgroundColor, |
| | | }" |
| | | > |
| | | <div class="card-header"> |
| | | <img :src="props.icon" class="card-icon" alt="" srcset="" /> |
| | | <span class="card-title">{{ props.title }}</span> |
| | | </div> |
| | | <div class="card-main"> |
| | | <el-scrollbar class="card-main"> |
| | | <slot /> |
| | | </el-scrollbar> |
| | | </div> |
| | | <div |
| | | class="bedside-auxiliary-screen-card" |
| | | :style="{ |
| | | '--bg-color': props.backgroundColor, |
| | | }" |
| | | > |
| | | <div class="card-header" :class="props.headerClassName"> |
| | | <img :src="props.icon" class="card-icon" alt="" srcset="" /> |
| | | <span class="card-title">{{ props.title }}</span> |
| | | <span class="card-right-text" v-if="$slots.right"> |
| | | <slot name="right" /> |
| | | </span> |
| | | </div> |
| | | </el-scrollbar> |
| | | <div class="card-main"> |
| | | <slot /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts" setup name="Card"> |
| | |
| | | title: string; // 标题 |
| | | icon: string; |
| | | height?: number; |
| | | headerClassName?: string; // 头部类名 |
| | | } |
| | | const props = defineProps<Props>(); |
| | | </script> |
| | |
| | | height: 100%; |
| | | |
| | | .card-header { |
| | | position: relative; |
| | | flex: 0 0 6px; |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .card-right-text { |
| | | position: absolute; |
| | | right: 0; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | font-family: PingFangSC, PingFang SC; |
| | | font-weight: 500; |
| | | font-size: 4px; |
| | | color: #333333; |
| | | line-height: 5px; |
| | | text-align: right; |
| | | font-style: normal; |
| | | } |
| | | } |
| | | |
| | | .card-main { |