由于是垂直滚动,通常会固定height,导致参数height被写死,手动更新height,然后执行update()。就ojbk了

 this.swiperOption = {
        height: document.documentElement.offsetHeight,
        direction: "vertical",
        speed: 500,
        mousewheel: true,
        on: {
          slideChangeTransitionStart: () => {
            this.curPage = this.swiper.activeIndex;
          },
          resize: () => {
            this.swiper.params.height = document.documentElement.offsetHeight;
            this.swiper.update(true);
          }
        }
      };
Logo

前往低代码交流专区

更多推荐