优化组件

This commit is contained in:
Sun 2024-01-05 13:58:58 +08:00
parent 0d0421c8eb
commit 3a82949afc
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ interface Prop {
textColor?: string textColor?: string
cardTypeStyle: PanelPanelConfigStyleEnum cardTypeStyle: PanelPanelConfigStyleEnum
// monitorType: string // monitorType: string
icon: string icon?: string
class?: string class?: string
backgroundColor?: string backgroundColor?: string
} }
@ -40,7 +40,7 @@ const propClass = ref(props.class)
<div class="w-[60px] h-[70px]"> <div class="w-[60px] h-[70px]">
<div class="w-[60px] h-full flex items-center justify-center text-white"> <div class="w-[60px] h-full flex items-center justify-center text-white">
<slot name="icon"> <slot name="icon">
<SvgIcon :icon="icon" style="width: 35px;height: 35px;" :style="{ color: textColor }" /> <SvgIcon :icon="icon ?? ''" style="width: 35px;height: 35px;" :style="{ color: textColor }" />
</slot> </slot>
</div> </div>
</div> </div>

View File

@ -19,7 +19,7 @@ defineProps<Prop>()
<template> <template>
<div class="w-full"> <div class="w-full">
<div v-if="cardTypeStyle === PanelPanelConfigStyleEnum.info"> <div v-if="cardTypeStyle === PanelPanelConfigStyleEnum.info">
<div class="mb-1" :style="{ color: textColor }"> <div class="mb-1 text-xs" :style="{ color: textColor }">
<span> <span>
{{ infoCardLeftText }} {{ infoCardLeftText }}
</span> </span>