首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

小程序table组件 满足基本需求

前端 3.08KB 9 需要积分: 1
立即下载

资源介绍:

小程序table组件 怎么用请参考https://blog.csdn.net/weixin_67585820/article/details/123791822
// components/table/table/table.js Component({ /** * 组件的属性列表 */ externalClasses: ['table-class', 'tr-class', 'td-class', 'th-class', 'tr-class_even', 'tr-class_odd'], properties: { colWidth: Number, isScroll: { type: Boolean, value: false }, header: { type: Array, value: [] }, list: { type: Array, value: [] }, showActive: { type: Boolean, value: true }, activeColor: { type: String, value: '#d6e8ff' }, maxLine: { type: Number, value: 2 } }, observers: { 'header,list': function (header, list) { this.init(); } }, /** * 组件的初始数据 */ data: { }, /** * 组件的方法列表 */ methods: { setWidth (head) { const colWidth = this.data.colWidth || head.length < 3 ? (730 / head.length) : 300; const tableWidth = head.length >= 1 && this.data.isScroll ? head.length * colWidth : null; this.setData({ tableWidth }); }, init () { !this.data.tableWidth && this.setWidth(this.data.header); const { list, header } = this.data; let showHeader = JSON.parse(JSON.stringify(header)); let showList = JSON.parse(JSON.stringify(list)); showHeader.forEach((head, headIndex) => { showList.forEach((item, index) => { const body = header[headIndex].renderBody && header[headIndex].renderBody(item, index); const color = header[headIndex].renderColor && header[headIndex].renderColor(item, index); const bg = header[headIndex].renderBg && header[headIndex].renderBg(item, index); if (body !== undefined) { head.key = `col${headIndex}`; item[`col${headIndex}`] = {}; item[`col${headIndex}`].text = body; } else if (head.key) { const text = item[head.key]; item[head.key] = { text }; } if (color && head.key) { item[head.key].color = color; } if (bg && head.key) { item[head.key].bg = bg; } }); }); this.setData({ showHeader, showList }); }, checkRow (index) { if (!this.data.showActive) { return; } index = /\d+/.test(index) ? index : 0; this.setData({ currentIndex: index }); }, onLongPress (e) { const { index } = e.currentTarget.dataset; this.checkRow(index); const data = this.data.list[index]; this.triggerEvent('onLongPress', { index, data }); }, onTap (e) { const { index } = e.currentTarget.dataset; this.checkRow(index); const data = this.data.list[index]; this.triggerEvent('onClick', { index, data }); } } });

资源文件列表:

table.zip 大约有6个文件
  1. table/
  2. table/table.js 2.82KB
  3. table/table.json 51B
  4. table/table.less 1.08KB
  5. table/table.wxml 1.07KB
  6. table/table.wxss 975B
0评论
提交 加载更多评论
其他资源 springboot+vue校园宿舍管理系统
springboot+vue校园宿舍管理系统  功能主要实现校园宿舍的宿舍管理,学生管理,班级管理,宿舍楼管理,以及维修记录管理,晚归管理,请假管理。 同时有一套系统管理,包含用户管理,角色管理,菜单管理,日志管理。
Synaptics病毒专杀工具
清除病毒,并恢复被病毒破坏的文件。 伪装成“Synaptics触摸板驱动程序”的新型蠕虫病毒,既可以通过带有恶意宏代码的Excel文档传播,也可以通过对正常的EXE文件进行偷梁换柱(将正常的EXE文件内容复制更新到病毒自身的资源段中)的方式传播。 当机器感染该病毒后,其会拦截用户新建Excel文档或者打开Excel文档的行为,并将新建或者打开的Excel文档替换成带有恶意宏代码的文档,恶意的宏代码主要功能是下载并执行病毒的主体文件Synaptics.exe,进一步感染其他机器。
Turbo C 3.0汉化版
Turbo C 3.0汉化版
基于python开发的简单的学生管理系统
设置了0积分下载,欢迎下载学习 Django的小试牛刀
Vue-Element UI集成ECharts实现数据统计分析页代码部分(如果帮助到你,感谢关注点赞)
关于《Vue-Element UI集成ECharts实现数据统计分析页》文章的具体代码实现。(如果帮助到你,感谢关注点赞)
vs2005(c# )皮肤控件
vs2005(c# )皮肤控件
Crossflash Dell H330 Raid to Stock HBA IT Firmware.zip
DELL H330 RAID卡刷直通模式,保证好用!
Everything更新windows专用版.zip
可以搜索到电脑上的所有文件。 同样是穷逼,所以免费提供