All Projects → JChehe → mini-program-table

JChehe / mini-program-table

Licence: MIT license
基于 WePY 实现的固定头和列的 table 组件,可根据自身需求进行修改扩展。

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to mini-program-table

Omi
Front End Cross-Frameworks Framework - 前端跨框架跨平台框架
Stars: ✭ 12,153 (+86707.14%)
Mutual labels:  mini-program, miniprogram
Wux Weapp
🐶 一套组件化、可复用、易扩展的微信小程序 UI 组件库
Stars: ✭ 4,706 (+33514.29%)
Mutual labels:  mini-program, miniprogram
Remax
使用真正的 React 构建跨平台小程序
Stars: ✭ 4,099 (+29178.57%)
Mutual labels:  mini-program, miniprogram
91 Python Mini Projects
No description or website provided.
Stars: ✭ 212 (+1414.29%)
Mutual labels:  mini-program, miniprogram
uniapp-scaffold
基于Vue.js的跨平台小程序脚手架、设计语言、组件库及插拔式模板
Stars: ✭ 87 (+521.43%)
Mutual labels:  miniprogram
jh-weapp-demo
微信小程序项目- 实现一些常用效果、封装通用组件和工具类
Stars: ✭ 60 (+328.57%)
Mutual labels:  table
numpy-html
Render NumPy arrays as HTML tables
Stars: ✭ 38 (+171.43%)
Mutual labels:  table
react-tisch
Table component for React and Bootstrap with real React components as cells
Stars: ✭ 17 (+21.43%)
Mutual labels:  table
timer-miniprogram
小程序定时器管理库,更合理地使用 setTimeout 和 setInterval,在页面显示时重启定时器,页面隐藏时暂停定时器,页面卸载时清除定时器
Stars: ✭ 26 (+85.71%)
Mutual labels:  miniprogram
miniprogram-demo
FinClip 小程序演示,用于测试小程序中相关 API 与组件能力 / Mini-Program DEMO for FinClip
Stars: ✭ 49 (+250%)
Mutual labels:  mini-program
vue3-table-lite
A simple and lightweight data table component for Vue.js 3. Features sorting, paging, row check, dynamic data rendering, supported TypeScript, and more.
Stars: ✭ 148 (+957.14%)
Mutual labels:  table
termtables
🖥️ Pretty tables in the terminal
Stars: ✭ 85 (+507.14%)
Mutual labels:  table
taro-icons
基于 Taro 的小程序图标库
Stars: ✭ 53 (+278.57%)
Mutual labels:  mini-program
taro3-vue3-template
一个基于 Taro3 和 Vue3 框架微信小程序模版。 核心技术采用Taro3、Vue3、TypeScript、NutUi、Vux4/Pinia、VueUse
Stars: ✭ 115 (+721.43%)
Mutual labels:  mini-program
python-realtime-table
Building realtime table using Python and Channels
Stars: ✭ 12 (-14.29%)
Mutual labels:  table
ediTable
Manipulation of table (sort, add, edit, remove, etc... - rows | valid cells, type, require, etc... cells )
Stars: ✭ 14 (+0%)
Mutual labels:  table
agel-table
element-ui table 的二次封装,保持灵活性,极简的思想,更少的代码,更多的功能,更快速的开发 ⬆⬆⬆
Stars: ✭ 26 (+85.71%)
Mutual labels:  table
SXAU-guide
微信小程序校园导航地图——小标识
Stars: ✭ 12 (-14.29%)
Mutual labels:  miniprogram
Table-Detection-using-Deep-Learning
Table Detection using Deep Learning
Stars: ✭ 24 (+71.43%)
Mutual labels:  table
react-native-simple-table
A simple table for react native.
Stars: ✭ 32 (+128.57%)
Mutual labels:  table

固定头和列的表格实现 —— 小程序

基于 WePY 实现,大家可根据自身需要进行更改扩展。

演示

Gif 演示

演示视频地址>>

实现原理

分层展示

  1. 橙色和紫色区域组成了横向滚动scroll-view
  2. 红色虚线区域是纵向滚动scroll-view。但由于绿色区域设置了 pointer-events: none;,即实际只能触摸橙色区域。通过在橙色区域绑定的 scroll 事件(纵向),实时设置绿色虚线区域的 scrollTop
  3. 紫色区域是固定头部,绿色区域是固定列。左上角的绿色区域是横向与纵向共同固定的区域。

实现要点

  1. 绑定了 scroll 事件的 scroll-view 要指定 throttle: false,否则回调函数有可能取不到最终位置的 scrollTop 值。官方文档目前未提及此属性,参考资料>>
  2. 固定列需要设置 pointer-events: none;,实现点击穿透。使得 tbody 能触发 scroll 事件,而不是为固定列也绑定 scroll 事件。
  3. 找出每列的最大单元格作为该列的宽度,当然你也可以显式设置。

peace out!👋

小程序 Bug

2019.09.03 更新
当将该组件至于 Popup 弹框,且该弹框通过 visibility: hidden/visible 切换,那么在 iOS 中,会使固定列(.table__fixed-columns)的 pointer-events: none 失效。

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