微信小程序--swiper

在一些小程序中,我们经常会发现有的页面可以滑动(左右 上下),它其实是使用了微信小程序中的swiper组件。接下来让我们详细介绍swiper

swiper:滑块视图容器

它包含多种属性:



等等。。

我们需要注意的是:在swiper中只可放置<swiper-item/>组件,否则会导致未定义的行为。

swiper-item

仅可放置在<swiper/>组件中,宽高自动设置为100%。

属性名类型默认值说明最低版本
item-idString""该 swiper-item 的标识符1.9.0
下面是一段swiper代码:(仅供参考)
 <swiper class='swiper' bindchange='change' current="{{currentid}}" wx:if="{{show_swiper}}">
  <block wx:for="{{paperdetails}}">
    <swiper-item>
      <form class='myfrm'>
        <view class='section_title'>{{index+1}}.{{item.content}}</view>
         <radio-group class="radio-group" bindchange='radioChange' data-id="{{item.id}}">
           <view class='question' bindtap='next'> 
              <label><radio value="a%{{item.scorea}}" />A.{{item.itema}}</label>
              <lable><radio value="b%{{item.scoreb}}" />B.{{item.itemb}}</lable>
              <lable wx:if="{{item.itemc!=''}}"><radio value="c%{{item.scorec}}"/>C.{{item.itemc}}</lable>
              <lable wx:if="{{item.itemd!=''}}"><radio value="d%{{item.scored}}"/>D.{{item.itemd}}</lable>
          </view> 
         </radio-group>
      </form>
    </swiper-item>
  </block>
</swiper>

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值