fix(design): card没有slots时隐藏对应slot

This commit is contained in:
roymondchen 2025-03-27 11:12:27 +08:00
parent 2a714ae9cc
commit 4ddc55aa6d
2 changed files with 3 additions and 3 deletions

View File

@ -1,10 +1,10 @@
<template>
<component class="tmagic-design-card" :is="uiComponent" v-bind="uiProps">
<template #header>
<template #header v-if="$slots.header">
<slot name="header" class="header"></slot>
</template>
<template #default>
<template #default v-if="$slots.default">
<slot name="default"></slot>
</template>
</component>

View File

@ -6,7 +6,7 @@
@update:modelValue="updateModelValue"
@change="changeHandler"
>
<template #default>
<template #default v-if="$slots.default">
<slot></slot>
</template>
</component>