原文地址:基于antd树形表格table的拖拽排序效果实现 - 掘金 (juejin.cn)
思路片段:
const DraggableBodyRow: React.FC<any> = ({ className, style, ...restProps }) => { const index = customInfoList.findIndex( ({ order: _index }) => _index === restProps['data-row-key'], ); // 头两行禁用 if ([0, 1].includes(index)) { return ( <tr className={className} // style={isDrag ? { cursor: 'move', opacity, ...style } : { ...style }} // data-handler-id={handlerId} {...restProps} /> ); } return <SortableItem index={index} className={className} {...restProps} />; };
标签:index,DraggableBodyRow,react,antd,table,拖拽 From: https://www.cnblogs.com/sangzs/p/17883837.html