mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-22 07:50:36 +01:00
docs(table): add drag and drop example (#3700)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -247,6 +247,18 @@ You can also pass the `value` of one of the items if provided.
|
||||
When `type="multiple"`, ensure to pass an array to the `default-value` prop or the `v-model` directive.
|
||||
::
|
||||
|
||||
### 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 Accordion. 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.
|
||||
|
||||
::component-example
|
||||
---
|
||||
name: 'accordion-drag-and-drop-example'
|
||||
---
|
||||
::
|
||||
|
||||
### With body slot
|
||||
|
||||
Use the `#body` slot to customize the body of each item.
|
||||
@@ -292,18 +304,6 @@ props:
|
||||
---
|
||||
::
|
||||
|
||||
### 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 accordion. 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 [Usage](https://vueuse.org/integrations/useSortable/#usage) for more examples.
|
||||
|
||||
::component-example
|
||||
---
|
||||
name: 'accordion-drag-and-drop-example'
|
||||
---
|
||||
::
|
||||
|
||||
## API
|
||||
|
||||
### Props
|
||||
|
||||
@@ -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