Coder Social home page Coder Social logo

wxapp-waterfall's Introduction

微信小程序 瀑布流组件

实现原理

  1. 双列瀑布流布局。
  2. 每次插入一条数据,动态获取左右两列的高度。
  3. 将下一条数据插入较短的一列。
  4. 可以在前端获取图片的宽高,但尽量与后端协商获取图片的高宽,可大幅度提高性能。

小程序代码片段

https://developers.weixin.qq.com/s/D5pyRRmO7eCh

文件夹结构

wxapp-waterfall
├─ components                   # 公用组件库
|  ├─ product                   # 商品列表组件
|  |  ├─ index.js
|  |  ├─ index.json
|  |  ├─ index.wxml
|  |  └─ index.wxss
│  └─ waterfall                 # 瀑布流组件
|     ├─ index.js
|     ├─ index.json
|     ├─ index.wxml
│     └─ lines.wxss
├─ index                        # 首页
|  ├─ index.js
|  ├─ index.json
|  ├─ index.wxml
|  └─ index.wxss
├─ utils                        # 工具库
|  └─ util.js
├─ .eslintrc.js
├─ app.js
├─ app.json
├─ app.wxss
├─ LICENSE
├─ project.config.json
├─ project.private.config.json
├─ README.md
└─ sitemap.json

wxapp-waterfall's People

Contributors

inklake 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.