Giter Club home page Giter Club logo

swiper-limited-load's Introduction

swiper-limited-load

一个答题小程序Demo, 包含做题页和答题卡页,并且新增了分页的demo

图片可能加载不出来,可看这两篇文章,有图片及对应的思路

csdn原文:微信小程序答题页实现——swiper渲染优化
微信小程序交流专区:微信小程序答题页实现——swiper渲染优化

示例动图

这里实现了如下功能和细节:
* 保证swiper-item的数量固定,加载大量数据时,大大优化渲染效率
* 记录上次的位置,页面初次加载不一定非得是第一页,可以是任何页
* 答题卡选择某一index回来以后的数据替换,并去掉swiper切换动画,提升交互体验



当加载300个item时,微信自带的swiper需要渲染将近4秒。而swiper-limited-load只加载3个item,渲染很快

使用方法

  • 将components中的swiper-limited-load复制到您的项目中
  • 在需要的页面引用此组件,并且创建自己的自定义组件item-view
  • 在初始化数据时,为你的list的每一项指定index属性
  • 具体可以参照项目目录start-swiper-limited-load中的用法
  • 分页的demo可以参照项目目录start-swiper-limited-load-paging中的用法
  • 说明:其它属性和swiper无异,你们可以自己单独添加你们需要的属性

如果对你有帮助,动动小手给个star,谢谢。

swiper-limited-load's People

Contributors

pengboboer avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.