mo 2 years ago
parent
commit
db9e241333
1 changed files with 8 additions and 1 deletions
  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],
       modules: [Navigation, Pagination, Scrollbar, Autoplay, A11y],
       bannerList: [],
       bannerList: [],
       leftHover: false,
       leftHover: false,
-      rightHover: false
+      rightHover: false,
+      swiper:null as any
     })
     })
     const router = useRouter()
     const router = useRouter()
     const onSwiper = swiper => {
     const onSwiper = swiper => {
+      state.swiper = swiper
       // console.log(swiper)
       // console.log(swiper)
     }
     }
     const onSlideChange = () => {
     const onSlideChange = () => {
@@ -53,6 +55,11 @@ export default defineComponent({
     }
     }
     onMounted(() => {
     onMounted(() => {
       getBannerList()
       getBannerList()
+      window.onresize = () => {
+        // state.swiper.updateSize()
+        window.location.reload()
+
+      }
     })
     })
     return () => (
     return () => (
       <>
       <>