修复图片轮播尺寸问题

This commit is contained in:
anln 2024-07-23 20:57:21 +08:00
parent 8983e84cf9
commit 0c273e4269
1 changed files with 3 additions and 3 deletions

View File

@ -67,7 +67,7 @@ export default function PersonSpace() {
})), })),
]; ];
// console.log("photosArr", photosArr); console.log("photosArr", photosArr);
setTopPhotos(photosArr); setTopPhotos(photosArr);
setLoading(false); setLoading(false);
} catch (error) { } catch (error) {
@ -170,7 +170,7 @@ export default function PersonSpace() {
{topPhotos.map((photo, index) => ( {topPhotos.map((photo, index) => (
<Swiper.Item key={index}> <Swiper.Item key={index}>
<div <div
className="relative min-w-max" className="relative min-w-full max-w-[100vw]"
key={index} key={index}
onClick={() => { onClick={() => {
if (photo.type == "video") { if (photo.type == "video") {
@ -183,7 +183,7 @@ export default function PersonSpace() {
} else { } else {
showPhotos( showPhotos(
topPhotos.filter((it) => it.type == "img"), topPhotos.filter((it) => it.type == "img"),
index topPhotos.filter((it) => it.type == "img").indexOf(photo)
); );
} }
}} }}