Skip to content

Data Table allow user drag rows to re-order them. 数据表格支持用户鼠标拖拽行以调整行顺序. #1563

Closed
@funwaywang

Description

@funwaywang

This function solves the problem (这个功能解决的问题)

Sometimes, the rows in the table have custom sortable fields, such as "priority, sort index". It would be great if the user is allowed to drag the rows to customize their order. 很多时候数据表格里的行有自定义的排序属性, 比如优先级等. 希望能提供一个开关, 允许用户拖拽行自定排序.

Expected API (期望的 API)

1). provide a switch to turn on custom-sort
<n-data-table ... :drag-to-sort="true" />

2). provider a callback, handle sort event
on-sort-drop (row: object, nextSibling: object) => void

the behavior like dragula (https://bevacqua.github.io/dragula/)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions