mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-22 16:00:39 +01:00
docs(table): add drag and drop example (#3700)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -444,6 +444,25 @@ class: '!p-0'
|
||||
---
|
||||
::
|
||||
|
||||
### With drag and drop
|
||||
|
||||
Use the [`useSortable`](https://vueuse.org/integrations/useSortable/) composable from [`@vueuse/integrations`](https://vueuse.org/integrations/README.html) to enable drag and drop functionality on the Table. This integration wraps [Sortable.js](https://sortablejs.github.io/Sortable/) to provide a seamless drag and drop experience.
|
||||
|
||||
The `useSortable` composable accepts various options, see the [useSortable](https://vueuse.org/integrations/useSortable/#usage) documentation for more examples.
|
||||
|
||||
::note
|
||||
Since the table ref doesn't expose the tbody element, add a unique class to it via the `:ui` prop to target it with `useSortable` (e.g. `:ui="{ tbody: 'my-table-tbody' }"`).
|
||||
::
|
||||
|
||||
::component-example
|
||||
---
|
||||
prettier: true
|
||||
collapse: true
|
||||
name: 'table-drag-and-drop-example'
|
||||
class: '!p-0'
|
||||
---
|
||||
::
|
||||
|
||||
### With slots
|
||||
|
||||
You can use slots to customize the header and data cells of the table.
|
||||
|
||||
Reference in New Issue
Block a user