我正在为滑块进行缩放,单击后“ swiper-container”旋转90度,显示全屏,隐藏其中的所有元素。我想使用分数分页,显示当前滑块和幻灯片数量,例如“ 1/8”。在初始状态下,仅在滑动容器旋转后才显示。问题是手动更新页面后分页显示。屏幕旋转更新时如何添加事件监听器。我已经尝试过“ observerUpdate”,但是它不起作用
const topSwiper = new Swiper(this.DOMTopSwiper.current, {
spaceBetween: 0,
observer: true,
observeParents: true,
observeSlideChildren: true,
navigation: {
nextEl: ".top-swiper-button-next",
prevEl: ".top-swiper-button-prev",
},
pagination: {
el: ".zoom-amount-slides",
type: "fraction",
},
})
topSwiper.on("observerUpdate", () => {
topSwiper.update()
})