diff --git a/packages/devui-vue/devui/card/src/card.tsx b/packages/devui-vue/devui/card/src/card.tsx index 03cd29e2e0..532aaca12a 100644 --- a/packages/devui-vue/devui/card/src/card.tsx +++ b/packages/devui-vue/devui/card/src/card.tsx @@ -19,16 +19,18 @@ export default defineComponent({ return () => (
{slots.default?.()} -
- {slots.avatar?.() ?
{slots.avatar?.()}
: ''} -
-
{slots.title?.()}
-
{slots.subtitle?.()}
+ {(slots.avatar || slots.title || slots.subtitle) && ( +
+ {slots.avatar?.() ?
{slots.avatar?.()}
: ''} +
+
{slots.title?.()}
+
{slots.subtitle?.()}
+
-
+ )} {src.value !== '' ? : ''} -
{slots.content?.()}
-
{slots.actions ? slots.actions?.() : ''}
+ {slots.content &&
{slots.content?.()}
} + {slots.actions &&
{slots.actions ? slots.actions?.() : ''}
}
); }, diff --git a/packages/devui-vue/docs/components/card/index.md b/packages/devui-vue/docs/components/card/index.md index 33d468b10a..116801561e 100644 --- a/packages/devui-vue/docs/components/card/index.md +++ b/packages/devui-vue/docs/components/card/index.md @@ -254,6 +254,7 @@ | title | 卡片的主要内容描述,一般定义为卡片名称 | | subtitle | 对标题的补充,可包含标签等信息 | | actions | 决策作用,可以包含操作文本或者操作图标 | +|default|自定义卡片内所有内容| ### Card 类型定义 diff --git a/packages/devui-vue/package.json b/packages/devui-vue/package.json index e288d7c07d..c116e85fd1 100644 --- a/packages/devui-vue/package.json +++ b/packages/devui-vue/package.json @@ -1,6 +1,6 @@ { "name": "vue-devui", - "version": "1.6.12", + "version": "1.6.13", "license": "MIT", "description": "DevUI components based on Vite and Vue3", "keywords": [