帖子
帖子
用户
博客
课程
显示全部楼层
27
帖子
0
勋章
245
Y币

[BUG] ios端 swiper current设置无效

[复制链接]
发表于 2023-6-26 10:18:05
<swiper class="swiper_box" :current="this.data.index" onchange={this.onchange}>
data(){return {index: 0,}} // 下标

// 点击弹框中的题号 跳转到指定题目
        toTopicTi(item) {
            this.data.index = item.showIndex-1
            this.onchange(this.data.index)
        },

        // 左右切换,更改下标
        onchange(index) {
            // 切换下标
            if (index != 0 && index.detail != undefined) {
                this.data.index = index.detail.current;
                console.log('滑动:' + this.data.index);
            } else if (index != 0) {
                this.data.index = index
                console.log('答题卡:' + this.data.index);
            }
            }






27
帖子
0
勋章
245
Y币
安卓没问题
380
帖子
4
勋章
6
Y币
您好,想实现什么功能?
current 不是组件滚动后,返回的值吗?不需要设置吧
27
帖子
0
勋章
245
Y币
技术咨询-F · 2023-6-28 11:01您好,想实现什么功能?
current 不是组件滚动后,返回的值吗?不需要设置吧

不设置的话 安卓也失效了
380
帖子
4
勋章
6
Y币
加油~! · 2023-6-29 17:58不设置的话 安卓也失效了

发一页最简测试代码,我们运行看看
27
帖子
0
勋章
245
Y币
技术咨询-F · 2023-6-29 18:51发一页最简测试代码,我们运行看看

已经换其他的方法了
您需要登录后才可以回帖 登录

本版积分规则