问题描述
在我的@ vue / cli 4.0.5 / vuedraggable 2.24.1中,我制作了两个带有可拖动元素的面板 从一个面板到另一个面板,但未在1个面板中排序。
在此处https://github.com/SortableJS/Vue.Draggable阅读文档 我看到了一个例子:
<draggable
v-model="list"
handle=".handle"
:group="{ name: 'people',pull: 'clone',put: false }"
ghost-class="ghost"
:sort="false"
@change="log"
>
<!-- -->
</draggable>
并且我希望定义:sort属性以及
dragOptions() {
return {
animation: 0,group: "description",disabled: !this.enable_tasks_dragging,ghostClass: "ghost"
}
},
这不是我期望的结果:项目可以从一个面板拖到另一个面板,然后 在1个面板中排序。如何不对1个面板中的项目进行排序?
谢谢!
解决方法
在Github页面上,所有可排序选项https://github.com/SortableJS/Vue.Draggable#all-sortable-options都有一个链接。你得到这个
导入您的项目:
// Default SortableJS
import Sortable from "sortablejs";
import { Sortable,MultiDrag,Swap,OnSpill,AutoScroll } from "sortablejs";
所以我认为您只需要手动选择所需的选项(import{...}