style: 单轮播图居中

This commit is contained in:
2025-10-30 07:55:40 +08:00
parent b166893bf6
commit 2296b23b34

View File

@@ -61,7 +61,12 @@ export default function Carousel(props) {
} }
return ( return (
<View className={styles["detail-swiper-container"]}> <View
className={styles["detail-swiper-container"]}
style={
list.length === 1 ? { display: "flex", justifyContent: "center" } : {}
}
>
<View <View
className={styles["detail-swiper-scroll-container"]} className={styles["detail-swiper-scroll-container"]}
style={{ width: listWidth + "px" }} style={{ width: listWidth + "px" }}