如何解决滑动拇指滑块不起作用
尝试创建将控制主画廊的缩略图画廊。我的代码如下:
import Swiper,{ Controller,Thumbs } from "swiper";
Swiper.use([Controller,Thumbs]);
...
...
const galleryThumbsEl = this.el.shadowRoot.querySelector(".thumbs-gallery") as HTMLElement;
this.galleryThumbs = new Swiper(galleryThumbsEl,{
direction: "vertical",spaceBetween: 6,slidesPerView: 4,slideToClickedSlide: true,watchSlidesVisibility: true,watchSlidesProgress: true,});
const galleryMainEl = this.el.shadowRoot.querySelector(".main-gallery") as HTMLElement;
this.mainGallery = new Swiper(galleryMainEl,{
slidesPerView: 1,thumbs: {
swiper: this.galleryThumbs,},});
this.mainGallery.controller.control = this.galleryThumbs;
视图如下:
行为方式: 当我拖动主滑块以更改幻灯片时,它也会更改,缩略图库幻灯片也会更改。但是单击缩略图库幻灯片不起作用。
因此,如果我单击拇指,它应该会更改主画廊的幻灯片,但不能那样工作。
我做错什么了吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。