Skip to content

fearclear/we-table

Repository files navigation

@fearcleari/wetable

目录

说明

  • 用于小程序table展示
  • 图片只支持网络图片
  • 采用rich-text渲染
  • 不支持所有节点的事件

用法

  1. 安装软件包

    npm i @fearcleari/wetable
    
  2. 引用we-table

    index.json / app.json
    "usingComponents": {
      "we-table": "@fearcleari/wetable"
    }
  3. 组件中书写对应的属性

    index.wxml
    <we-table
    scroll="{{scroll}}"
    columns="{{columns}}"
    dataSource="{{dataSource}}"
     >
     </we-table>
    index.js
    Page({
        data: {
            columns: [
                {dataIndex: 'name', title: 'Full Name', fixed: 'left', width: 100},
                {dataIndex: 'age', title: 'Age',width: 100},
                {dataIndex: 'address', title: 'Address'},
            ],
            scroll: {
                x: 750,
                y: 300
            },
            dataSource: [
                {name: 'Mike', age: 12, address: 'Nan.Street'},
                {name: 'Mike', age: 12, address: 'Nan.Street'},
                {name: 'Mike', age: 12, address: 'Nan.Street'},
                {name: 'Mike', age: 12, address: 'Nan.Street'}
            ]
        }
    })

API

Table

参数 说明 类型 默认值
tableLayout 表格元素的table-layout属性,设为fixed表示内容不会影响列的布局 - | auto | fixed
固定表头/列或使用了column.ellipsis时,默认值为fixed

测试

About

table for miniprogram

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published