swiper懒加载应该如何处理?
来源:8-7 读取器的巧妙应用
萧俊介
2017-08-02
<!-- 标签页 -->
<view class="swiper-tab">
<view class="swiper-tab-text">News</view>
<view class="swiper-tab-show">
<block wx:for="{{movies}}" wx:key="">
<view class="swiper-tab-list {{currentTab==index ? 'on' : ''}}" data-current="{{index}}" data-classnews="{{item.id}}" bindtap="swichNav">{{item.title}}</view>
</block>
</view>
</view>
<swiper current="{{currentTab}}" class="swiper-box" duration="300" style="height:968rpx" bindchange="bindChange">
<swiper-item wx:for="{{movies}}" wx:key="">
<template is="indexNewItemList" data="{{currentTab==index ? 'newname' : ''}}" />
</swiper-item>
</swiper>我所想到的方法就是这样进行判断
data="{{currentTab==index ? 'newname' : ''}}但这写会报错。
我不想一次就加载来出,而是根据当前的index懒加载应该如何处理?
写回答
1回答
-
7七月
2017-08-02
swiper这个有一个当前位置的事件啊,你可以从事件里取到当前序号。
012017-08-03
相似问题