1.2.8 • Published 4 years ago

b-app-table v1.2.8

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

基于 antd table 的二次封装

#Example

yarn start


#Used

import AppTable from "b-app-table"

...

<AppTable
  ref={ref => (this.tableRef = ref)}
  page={1}
  rowKey="id"
  columns={this.columns}
  options={this.state.filterOptions}
  tableOptions={this.state.tableOptions}
  request={this.getList}
/>

指定一个 col 的 sorter,设置其 type 为'sort', options 设置排序参数,此排序为后端排序.

options 是 table 查询条件,对象.

tableOptions 是 table 状态,包括 page,size,sort 等,对象.

getList 是请求 dataSource 的接口函数,接收一个当前查询条件为参数,返回为:

 {
   list:[],//table data
   total:100
 }

#Publish

yarn publish