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

1.4k views Asked by At

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?

Thanks!

1

There are 1 answers

1
zerbene On

On the Github page there is a link for all sortable option https://github.com/SortableJS/Vue.Draggable#all-sortable-options. And you obtain this

Import into your project:

// Default SortableJS
import Sortable from "sortablejs";
import { Sortable, MultiDrag, Swap, OnSpill, AutoScroll } from "sortablejs";

So I think you just have to choose manually the options ( import{...} ) that you want