feat: 商城轮播图装修组件增加高度配置

pull/151/MERGE
puhui999 2025-06-18 18:11:00 +08:00
parent 80d500ed00
commit 324949dbc2
1 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,7 @@
:autoplay="data.autoplay" :autoplay="data.autoplay"
:interval="data.interval * 1000" :interval="data.interval * 1000"
:mode="data.type" :mode="data.type"
:height="px2rpx(data.height)"
/> />
</template> </template>
@ -28,6 +29,12 @@
}, },
}); });
function px2rpx(px) {
//
let scale = uni.upx2px(100)/100;
return px/scale
}
const imgList = computed(() => const imgList = computed(() =>
props.data.items.map((item) => { props.data.items.map((item) => {
const src = item.type === 'img' ? item.imgUrl : item.videoUrl; const src = item.type === 'img' ? item.imgUrl : item.videoUrl;