收藏
回答

swiper初始化显示最后一张

问题模块 框架类型 问题类型 终端类型 微信版本 基础库版本
框架 小程序 Bug 工具 6.5.3 1.02

初始化swiper的时候,会直接显示最后一个swiper-item,我需要显示的是第一个



<swiper current="{{currentTab}}" duration="300" > <swiper-item catchtouchmove="stopTouchMove"> <view class='cover-content'> <view class='cover-close' bindtap='closeCover'> <image src='../../images/close.png'></image> </view> <view class='cover-content-title'>请绑定您的身份信息</view> <form bindsubmit='nextOperation'> <view class='input-list'> <view class='input-icon'> <image src='../../images/iphone-icon.png' mode='widthFix'></image> </view> <input placeholder='请输入手机号' name='phone' value='{{phone}}' type='number' maxlength='11' auto-focus /> </view> <view class='input-list'> <view class='input-icon'> <image src='../../images/head-icon.png' mode='widthFix'></image> </view> <input placeholder='请输入您的真实姓名' name='name' value='{{name}}' type='text' maxlength='11' /> </view> <view class='input-list'> <view class='input-icon'> <image src='../../images/card-icon.png' mode='widthFix'></image> </view> <input placeholder='请输入您的身份证号码' name='idNumber' value='{{idNumber}}' type='number' maxlength='18' /> </view> <view class='input-list'> <view class='input-icon'> <image src='../../images/key-icon.png' mode='widthFix'></image> </view> <input style='width:400rpx' placeholder='请输入图像验证码' name='idCode' value='{{idCode}}' type='text' maxlength='4' /> <view class='idCode' bindtap="onTap"> <canvas style="width:150rpx;height:70rpx;position:absolute;right:0rpx;bottom:10rpx;text-align: center;z-index:9999;" canvas-id="canvas"></canvas> </view> </view> <button class='submitBtn' form-type='submit'>下一步</button> </form> </view> </swiper-item> <swiper-item catchtouchmove="stopTouchMove"> <view class='cover-content'> <view class='cover-close' bindtap='closeCover'> <image src='../../images/close.png'></image> </view> <view class='cover-content-title'>请绑定您的身份信息</view> <form bindsubmit='nextOperation'> <view class='input-list'> <view class='input-icon'> <image src='../../images/iphone-icon.png' mode='widthFix'></image> </view> <input placeholder='请输入手机号' name='phone' value='{{phone}}' type='number' maxlength='11' auto-focus /> </view> <view class='input-list'> <view class='input-icon'> <image src='../../images/head-icon.png' mode='widthFix'></image> </view> <input placeholder='请输入您的真实姓名' name='name' value='{{name}}' type='text' maxlength='11' /> </view> <view class='input-list'> <view class='input-icon'> <image src='../../images/card-icon.png' mode='widthFix'></image> </view> <input placeholder='请输入您的身份证号码' name='idNumber' value='{{idNumber}}' type='number' maxlength='18' /> </view> <button class='submitBtn' form-type='submit'>下一步</button> </form> </view> </swiper-item> <swiper-item catchtouchmove="stopTouchMove"> <view class='cover-content'> <view class='cover-close' bindtap='closeCover'> <image src='../../images/close.png'></image> </view> <view class='cover-content-title'>请绑定您的身份信息</view> <form bindsubmit='nextOperation'> <view class='input-list'> <view class='input-icon'> <image src='../../images/iphone-icon.png' mode='widthFix'></image> </view> <input placeholder='请输入手机号' name='phone' value='{{phone}}' type='number' maxlength='11' auto-focus /> </view> <view class='input-list'> <view class='input-icon'> <image src='../../images/head-icon.png' mode='widthFix'></image> </view> <input placeholder='请输入您的真实姓名' name='name' value='{{name}}' type='text' maxlength='11' /> </view> <button class='submitBtn' form-type='submit'>下一步</button> </form> </view> </swiper-item> </swiper>
最后一次编辑于  2018-12-10  (未经腾讯允许,不得转载)
回答关注问题邀请回答
收藏

2 个回答