swiper (vue-awesome-swiper) 垂直滚动(direction:vertical),window.resize,swiper.update() 自适应无效解决方案
由于是垂直滚动,通常会固定height,导致参数height被写死,手动更新height,然后执行update()。就ojbk了this.swiperOption = {height: document.documentElement.offsetHeight,direction: "vertical",speed: 500,mousewheel: true,on: {slideChangeT
·
由于是垂直滚动,通常会固定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);
}
}
};
更多推荐
已为社区贡献1条内容
所有评论(0)