You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The draggable wrapper has to land inside the tbody slot of v-data-table
the draggable itself has an additional slot of '#item'
The table ends up heaving either 2x tbody or 2x tr and therefore is breaking the table structure of tbody-tr-td
Therefore the UI breaks.
Actual Solution
In Vuedraggable 2, the draggable component did not have a named slot inside, so only one tag in html appeared.
In order to work in vuetify 3, we need to use the v-table component.
Not using v-data-table we are losing its default functionality including headers and pagination.
Expected Solution
The solution would be to allow the Draggable component to be a 'transparent' div, or its item slot to be a 'transparent' template, or to enable the item slot to render multiple children (as it shows an error of only 1 child to be rendered in the slot - but not accepting the template tag).
The text was updated successfully, but these errors were encountered:
Yeah I managed to work around this fairly easy and with quite little effort
The issue is actually the double rendered tbody that comes from the <template #body={ items } /> slot. This was never an issue in Vuetify2 because the body slot allowed you to defined the tbody tag yourself as well. That would look something like this:
This will render the tbody twice though and will mess up the table structure. But in vue3 when you add the following snippet in an onMounted callback of the component that renders the table it should look good and work all again.
Keep in mind you have to take the whole draggable DOM node otherwise it won't of course work. That's why in the draggable component I have set the tag to tbody to exactly replace the tbody that is automatically placed there by Vuetify.
Small disclaimer: I have only used this in Vue3 not with Nuxt3, there might be some complications with the whole SSR part, but I'm sure you can get around that by executing the onMount part only client side.
Github repo link:
https://github.com/wcywin/nuxt-3-vuetify-3-vuedraggable-v-data-table
Netlify link:
https://cerulean-tanuki-4c3a9e.netlify.app/
Step-by-step scenario
Actual Solution
Expected Solution
The text was updated successfully, but these errors were encountered: