SortableRow

SortableRow is used to customize the draggable row of an antd Table.

Basic Usage

import { DndContext } from '@dnd-kit/core';
import { SortableContext } from '@dnd-kit/sortable';
import { SortableRow } from '@nocobase/client-v2';
import { Table } from 'antd';

<DndContext>
  <SortableContext items={records.map((record) => record.id)}>
    <Table rowKey="id" components={{ body: { row: SortableRow } }} columns={columns} dataSource={records} />
  </SortableContext>
</DndContext>;

API

PropTypeDescription
rowIndexnumberCurrent row index
classNamestringCustom class name