An open API service indexing awesome lists of open source software.

https://github.com/cczx/react-sort-table

可拖拽排序的react表格组件
https://github.com/cczx/react-sort-table

component drag-and-drop react sort storybook table tsdx

Last synced: about 2 months ago
JSON representation

可拖拽排序的react表格组件

Awesome Lists containing this project

README

          

# A react table component that can be dragged and sorted

## install

```bash
// npm
npm install react-drag-sort-table

// yarn
yarn add react-drag-sort-table
```
## use

```js
import DragSortTable from 'react-drag-sort-table'
import 'react-drag-sort-table/dist/dist.min.css'
```
## API

### Table

| prop | description | 类型 | required | default value |
| ---- | ---- | ---- | ---- | ---- |
| dataSource | 数据数组 | object[] | true | [] |
| columns | | | true | |
| canDragSort | 是否使用拖拽排序 | boolean | false | rue |
| canAdjustWidth | 是否可以调整宽度 | | false | |
| customDragSortIcon | | | false | |
| align | | | false | |
| onSortDataSource | dataSource顺序改变处理函数,参数分别是当前的值,当前行的值,当前行索引 | (text, rowData, index) => void | true | |