diff --git a/sheep/components/s-image-banner/s-image-banner.vue b/sheep/components/s-image-banner/s-image-banner.vue index 478e7af7..a4e9a01a 100644 --- a/sheep/components/s-image-banner/s-image-banner.vue +++ b/sheep/components/s-image-banner/s-image-banner.vue @@ -9,6 +9,7 @@ :autoplay="data.autoplay" :interval="data.interval * 1000" :mode="data.type" + :height="px2rpx(data.height)" /> @@ -28,6 +29,12 @@ }, }); + function px2rpx(px) { + //计算比例 + let scale = uni.upx2px(100)/100; + return px/scale + } + const imgList = computed(() => props.data.items.map((item) => { const src = item.type === 'img' ? item.imgUrl : item.videoUrl;