All Projects → kapeter → mpMasonry

kapeter / mpMasonry

Licence: other
小程序瀑布流组件

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to mpMasonry

natsuha-weather
Natsuha Weather for WeChat Mini Program.
Stars: ✭ 33 (-5.71%)
Mutual labels:  wechat-mini-program
elf-taro
Taro 小程序 脚手架 (Taro 3 + Dva + Typescript + Immer) - 内置 Redux 计数器, 异步数据请求 与 腾讯小程序地图 demo
Stars: ✭ 61 (+74.29%)
Mutual labels:  wechat-mini-program
WX MultiTabList
微信小程序,多个Tab列表的上下拉刷新方案
Stars: ✭ 25 (-28.57%)
Mutual labels:  wechat-mini-program
react-native-masonry-list
The Masonry List implementation which has similar implementation as the `FlatList` in React Native
Stars: ✭ 255 (+628.57%)
Mutual labels:  masonry
uniapp-scaffold
基于Vue.js的跨平台小程序脚手架、设计语言、组件库及插拔式模板
Stars: ✭ 87 (+148.57%)
Mutual labels:  wechat-mini-program
CHCharts-wechat
📈A charts component for WeChat mini-app development(一款用于微信小程序开发中的图表组件,使用者可以快速添加并集成到微信小程序开发中).
Stars: ✭ 71 (+102.86%)
Mutual labels:  wechat-mini-program
react-mason
React Masonry grid
Stars: ✭ 13 (-62.86%)
Mutual labels:  masonry
wx-biz-data-crypt
微信小程序用户加密数据解密Go的实现
Stars: ✭ 24 (-31.43%)
Mutual labels:  wechat-mini-program
fish
Pixi.js 开发微信小游戏示例
Stars: ✭ 37 (+5.71%)
Mutual labels:  wechat-mini-program
we-timer
🌈⏱ A beautiful interval timer wechat miniprogram | 一个好看的间隔计时微信小程序
Stars: ✭ 61 (+74.29%)
Mutual labels:  wechat-mini-program
weapp-poem
诗词墨客 - 最全中华古诗词小程序
Stars: ✭ 409 (+1068.57%)
Mutual labels:  wechat-mini-program
masonry-css
Create mosaic grid, like masonry, with css only
Stars: ✭ 17 (-51.43%)
Mutual labels:  masonry
wechat-scroll-linkage
微信小程序列表左右联动效果
Stars: ✭ 26 (-25.71%)
Mutual labels:  wechat-mini-program
taro3-vue3-template
一个基于 Taro3 和 Vue3 框架微信小程序模版。 核心技术采用Taro3、Vue3、TypeScript、NutUi、Vux4/Pinia、VueUse
Stars: ✭ 115 (+228.57%)
Mutual labels:  wechat-mini-program
microteam
小团队管理 是一款开源的微信小程序,主要用于日常的团队管理
Stars: ✭ 40 (+14.29%)
Mutual labels:  wechat-mini-program
Course-table
微信小程序,课程表最佳实践案例。
Stars: ✭ 15 (-57.14%)
Mutual labels:  wechat-mini-program
edu
微信小程序编写的移动互联网教育平台
Stars: ✭ 41 (+17.14%)
Mutual labels:  wechat-mini-program
WxJumpHelper
wechat game helper(jump) 微信小游戏:跳一跳 辅助程序
Stars: ✭ 17 (-51.43%)
Mutual labels:  wechat-mini-program
react-plock
Plock is a responsive masonry layout implementation for React.
Stars: ✭ 118 (+237.14%)
Mutual labels:  masonry
wx-mini-navigationbar
微信小程序自定义标题栏
Stars: ✭ 20 (-42.86%)
Mutual labels:  wechat-mini-program

mpMasonry

小程序瀑布流组件

基本使用

1、将components目录下中masonry文件夹复制到自己项目中。
2、添加业务组件,并在业务组件中添加property,用于承载数据
// property名必须为item
properties: {
    item: { 
        type: Object
    }
}
3、引入masonry组件和所需的业务组件
// index.json
"usingComponents": {
    "masonry": "../../components/masonry/masonry",
    "img-box": "../../components/img-box/img-box"
}
4、在wxml加入masonry节点
<!-- index.wxml -->
<masonry generic:masonry-item="img-box" id="masonry" interval-width="20rpx"></masonry>

generic:masonry-item用于指定业务组件,interval-width为左右两列空隙宽度。

5、调用函数,渲染瀑布流
_doStartMasonry(items) {
    // 通过ID,获取组件实例
    this.masonryListComponent = this.selectComponent('#masonry');
    // 调用组件的start函数,渲染瀑布流
    this.masonryListComponent.start(items).then(() => {
        console.log('render completed')
    })
}

为保证页面显示效果,建议一次渲染不超过100个元素。

函数列表

函数名 函数功能 参数说明 返回值
append 批量添加元素 {Array} items - 新增的元素数组 Promise
delete 批量删除瀑布流中的元素 {Number} start - 开始下标
{Number} end - 结束下标
deleteItem 删除瀑布流中的某个元素 {Number} index - 数组下标
start 启动组件,开始渲染瀑布流 {Array} items - 参与渲染的元素数组 Promise
stop 停止渲染瀑布流,清空数据
updateItem 更新渲染数组中的某个元素 {Object} newItem - 修改后的元素
{Number} index - 需要更新的数组下标

实践案例

京东种草

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].