mo 2 년 전
부모
커밋
db9e241333
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      src/components/banner/index.tsx

+ 8 - 1
src/components/banner/index.tsx

@@ -24,10 +24,12 @@ export default defineComponent({
       modules: [Navigation, Pagination, Scrollbar, Autoplay, A11y],
       bannerList: [],
       leftHover: false,
-      rightHover: false
+      rightHover: false,
+      swiper:null as any
     })
     const router = useRouter()
     const onSwiper = swiper => {
+      state.swiper = swiper
       // console.log(swiper)
     }
     const onSlideChange = () => {
@@ -53,6 +55,11 @@ export default defineComponent({
     }
     onMounted(() => {
       getBannerList()
+      window.onresize = () => {
+        // state.swiper.updateSize()
+        window.location.reload()
+
+      }
     })
     return () => (
       <>