SortableJS / Vue.Draggable

Vue drag-and-drop component based on Sortable.js
https://sortablejs.github.io/Vue.Draggable/
MIT License
20.11k stars 2.9k forks source link

How with Vue.Draggable make not to sort items inside 1 panel? #945

Open PetroGromovo opened 4 years ago

PetroGromovo commented 4 years ago

Hello, In my @vue/cli 4.0.5 / vuedraggable 2.24.1 I make 2 panels with elements which can be dragged from one panel to other, but not sorted inside 1 panel.

Reading docs here https://github.com/SortableJS/Vue.Draggable I see example:

<draggable
        v-model="list"
        handle=".handle"
        :group="{ name: 'people', pull: 'clone', put: false }"
        ghost-class="ghost"
        :sort="false"
        @change="log"
      >
      <!-- -->
</draggable>

and I expect that defining :sort property and with

            dragOptions() {
                return {
                    animation: 0,
                    group: "description",
                    disabled: !this.enable_tasks_dragging,
                    ghostClass: "ghost"
                }
            },

That result is not I expect : items can dragged from one panel to other and sorted inside 1 panel. How to make not to sort items inside 1 panel?

I added the import line with options from https://github.com/SortableJS/Vue.Draggable#all-sortable-options But If I hide most of options : import { /* Sortable, MultiDrag, Swap, OnSpill, */ AutoScroll } from "sortablejs" I still have sorting inside 1 panel. have I to write these options somewhere else ?

Thanks!

David-Desmaisons commented 3 years ago

Sorry, I can not follow you. What is your template?

PetroGromovo commented 3 years ago

Which template do you mean ? If my question poorly formulated ?

zhuwenqi001 commented 3 years ago

Maybe you can set handle="xxx" that can't find the element to the pane1. property sort is designed to prevent the sorting result,it can't block the dragging process