From 92db148237c4d4d63a59aa624acf520dce043e11 Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Tue, 23 Dec 2025 11:45:03 +0800 Subject: [PATCH] =?UTF-8?q?chore(diy-article):=20=20=E6=94=AF=E6=8C=81diy-?= =?UTF-8?q?article=20=E7=BB=84=E4=BB=B6=E5=85=B3=E4=BA=8E=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=8E=A7=E5=88=B6=E7=9A=84=E5=8F=82=E6=95=B0=E5=8C=96?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy-components/diy-article.vue | 75 +++++++++++++++-------- 1 file changed, 51 insertions(+), 24 deletions(-) diff --git a/components/diy-components/diy-article.vue b/components/diy-components/diy-article.vue index 30aec58..2f8bee2 100644 --- a/components/diy-components/diy-article.vue +++ b/components/diy-components/diy-article.vue @@ -3,8 +3,14 @@ - + @@ -41,18 +47,18 @@ } }, data() { - return { - list: [], - loading: true, - skeletonConfig: { - gridRows: 1, - gridRowsGap: '40rpx', - headWidth: '160rpx', - headHeight: '160rpx', - textRows: 2 - } - }; - }, + return { + list: [], + loading: true, + skeletonConfig: { + gridRows: 1, + gridRowsGap: '40rpx', + headWidth: '160rpx', + headHeight: '160rpx', + textRows: 2 + } + }; + }, created() { this.getList(); }, @@ -63,6 +69,10 @@ } }, computed: { + // 获取swiper配置,默认空对象 + swiperConfig() { + return this.value?.swiperConfig || {}; + }, warpCss() { var obj = ''; obj += 'background-color:' + this.value.componentBgColor + ';'; @@ -74,6 +84,15 @@ } return obj; }, + // swiper容器样式 + swiperStyle() { + // 从swiperConfig获取高度,默认600rpx + const height = this.swiperConfig.swiperHeight || 600; + return { + height: height + 'rpx', + width: '100%' + }; + }, // 子项样式 itemCss() { var obj = ''; @@ -130,21 +149,29 @@