SortableJS / vue.draggable.next

Vue 3 compatible drag-and-drop component based on Sortable.js
https://sortablejs.github.io/vue.draggable.next/#/simple
MIT License
3.79k stars 520 forks source link

Uncaught (in promise) TypeError: scopedSlot is undefined #234

Open liushuai05 opened 1 year ago

liushuai05 commented 1 year ago

Of course, I saw that this problem had been solved in https://github.com/SortableJS/Vue.Draggable/issues/881, but it didn't seem to work in my environment and still reported this error.

Uncaught (in promise) TypeError: scopedSlot is undefined
    getSlot vuedraggable.js:59
    computeChildrenAndOffsets vuedraggable.js:65
    render vuedraggable.js:167
    renderComponentRoot runtime-core.esm-bundler.js:895
    componentUpdateFn runtime-core.esm-bundler.js:5059
    run reactivity.esm-bundler.js:185
    setupRenderEffect runtime-core.esm-bundler.js:5185
    mountComponent runtime-core.esm-bundler.js:4968
    processComponent runtime-core.esm-bundler.js:4926
    patch runtime-core.esm-bundler.js:4518

I downloaded the files in the src directory directly and put them in my project, and it seems to have worked. I wonder if the pacage on npmjs is not updated to the latest, but the version number I pulled by yarn is 4.0.2, which is higher than the tag version in the current project. I don't know why.

ephrimlawrence commented 11 months ago

In my case (vite + vue3), I resolved the error by directly importing the CommonJS dist module.

Change your import from

import draggable from "vuedraggable"

to

import draggable from "vuedraggable/dist/vuedraggable.common";
qZhiKing commented 3 months ago

I also encountered this problem, but none of the solutions said on the Internet have been solved, I don't know if it is a VUE version compatibility problem (^3.4.27)

ashley00101010 commented 3 months ago

doesn't work for me