适用于 vue3 + ts 的 h5 移动端项目 table 组件
支持 左侧固定 滑动 每行点击回调 支持 指定列排序
链接 :https://github.com/duKD/vue3-h5-table
props | 说明 |
---|---|
minTableHeight | 表格最小高度 可选 默认600 |
rowNum | 表格显示几行 可选 默认 6 |
headerHeight | 头部默认高度 可选 默认 60 |
rowHeight | 每行数据的默认高度 默认 100 |
column | 每列数据说明 见下文 |
tableDatas | 表格数据 |
fixedHeader | 是否固定表头 默认true |
export type columnItemType = {title:string // 列名dataIndex?:string // table data key 值 width?:number // 列 宽度slotKey?:string // 插槽作用域 idsortable?:boolean //是否 支持排序align?: 'left'|'center'|'right' // 布局key?:string // 哪个列数据 作为 唯一key 值 默认 indexrender?:(h:renderType,row:any)=>void // 自定义render
}
使用 实例:
{{ item.select }}{{ item.type === 1 ? "深" : "沪" }}{{ item.markValue }} {{ item.position }}{{ item.use }} {{ item.cur }}{{ item.cost }} {{ item.float }}{{ item.profit }} 0">买入卖出行情
具体使用参考 github 项目中 app.vue 文件