feat(diy-article): 支持diy-article 组件内的内容自动垂直滚动

This commit is contained in:
2025-12-23 11:22:29 +08:00
parent 1d7629168c
commit 96049bbcae

View File

@@ -2,7 +2,12 @@
<x-skeleton data-component-name="diy-article" type="list" :loading="loading" :configs="skeletonConfig">
<view class="article-wrap" :style="warpCss">
<view :class="['list-wrap', value.style]" :style="warpCss">
<view :class="['item', value.ornament.type]" v-for="(item, index) in list" :key="index" @click="toDetail(item)" :style="itemCss">
<!-- 自动垂直滚动 -->
<swiper class="auto-scroll-swiper" vertical="true" autoplay="true" circular="true"
interval="3000" duration="500" display-multiple-items="3">
<swiper-item v-for="(item, index) in list" :key="index" @click="toDetail(item)">
<view class="swiper-item-content">
<view :class="['item', value.ornament.type]" :style="itemCss">
<view class="article-img">
<image class="cover-img" :src="$util.img(item.cover_img)" mode="widthFix" @error="imgError(index)" />
</view>
@@ -19,6 +24,9 @@
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
</view>
</x-skeleton>
</template>
@@ -123,10 +131,20 @@
.article-wrap {
.list-wrap {
&.style-1 {
.auto-scroll-swiper {
height: 480rpx;
width: 100%;
}
.swiper-item-content {
width: 100%;
box-sizing: border-box;
}
.item {
display: flex;
padding: 20rpx;
margin-top: 24rpx;
height: 120rpx;
box-sizing: border-box;
&:first-of-type {
margin-top: 0;