From 78fa38c25183d09cadf2debd64698229e27ccfa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=8C=E8=A8=80?= <2311595895@qq.com> Date: Thu, 18 Apr 2024 11:22:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(Card):=20=E4=BC=98=E5=8C=96=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=BB=93=E6=9E=84=20(#1832)=20(#1833)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/devui-vue/devui/card/src/card.tsx | 18 ++++++++++-------- .../devui-vue/docs/components/card/index.md | 1 + packages/devui-vue/package.json | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) 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": [