소스 검색

feat: 添加自动滚动

year 2 달 전
부모
커밋
e0450bf89d
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/app/[locale]/(enter)/login/adbox.tsx

+ 2 - 2
src/app/[locale]/(enter)/login/adbox.tsx

@@ -2,7 +2,7 @@
 import { AdItem } from "@/api/customservice";
 import { useRouter } from "@/i18n/routing";
 import React from "react";
-import { Pagination } from "swiper/modules";
+import { Autoplay, Pagination } from "swiper/modules";
 import { Swiper, SwiperSlide } from "swiper/react";
 
 interface AdboxProps {
@@ -34,7 +34,7 @@ const Adbox: React.FC<AdboxProps> = ({ data }) => {
             <Swiper
                 spaceBetween={10}
                 autoplay
-                modules={[Pagination]}
+                modules={[Pagination, Autoplay]}
                 pagination={{ clickable: true }}
             >
                 {!!data?.length &&