查看: 1543|回复: 0
打印 上一主题 下一主题

swiper创建

[复制链接]

该用户从未签到

1

主题

1

帖子

3

积分

新手上路

Rank: 1

积分
3
跳转到指定楼层
楼主
发表于 2019-12-27 14:10:33 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
that.swp = new Swiper(".swiper-container", {
                loop: false,
                on: {
                    slideChangeTransitionStart: function() {
                        that.showback = false;
                        if (program[this.realIndex].type === 1) {
                            let element;
                            element = that.el.nativeElement.querySelectorAll(
                                "#dplayer" + program[this.realIndex].id
                            )[0];
                            if (!that.dPlayers[this.activeIndex]) {
                                console.log("创建播放器之前", this.activeIndex);
                                that.initVideo(
                                    element,
                                    program[this.realIndex],
                                    this.activeIndex
                                );
                            }
                        }
                    },
                    slideNextTransitionEnd: function() {
                        that.slideNext(this.activeIndex);
                    },
                    slidePrevTransitionEnd: function() {
                        that.slidePrev(this.activeIndex);
                    },
                    click: function() {
                        that.click(this.realIndex, this.activeIndex);
                    }
                }
            });

我写了一个swiper的初始化打印this.swiper出来的确是一个数组导致使用this.swp.slidePrev()报错如何解决这种问题



分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Swiper中文网 ( 粤ICP备15001020号

GMT+8, 2024-4-24 11:32 , Processed in 0.073443 second(s), 30 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表