vue-draggable-plus 使用 一、基本信息和功能 vue-draggable-plus 是一个基于 SortableJS 的 Vue.js 插件,提供了丰富的拖拽排序功能。相比于其他拖拽组件,它支持更多的定制化选项,如动画、拖拽方向、占位符、动态数据等。这使得 vue-draggable-plus 成为 Vue 项目中实现拖拽排序功能的理想选择。
在Sortablejs官方以往的Vue组件中,都是通过使用组件作为列表的直接子元素来实现拖拽列表,当我们使用一些组件库时,如果组件库中没有提供列表根元素的插槽,我们很难实现拖拽列表,vue-draggable-plus 完美解决了这个问题,它可以让你在任何元素上使用拖拽列表,我们可以使用指定元素的选择器,来获取到列表根元素,然后将列表根...
根据VueDraggablePlus 的作者表示,功能强大的 Sortablejs 一直是前端领域比较知名的拖拽工具库,在2020年我也推荐过官方的 Vue.Draggable,不过这个库的 Vue3 版本一直没有更新,和目前主流的 Vue3 已经严重脱节了,于是才有了 VueDraggablePlus 项目,他们基于 Sortablejs 封装了多种用法,让其支持 Vue3,并且支持以组件...
const moveToThird= (arr: any, index: number, insert: number) =>{//移除数组中指定索引的元素,并在第三个位置插入该元素const element = arr.splice(index, 1)[0]; arr.splice(insert,0, element);returnarr }
import { VueDraggable } from 'vue-draggable-plus'; export default defineComponent({ name: 'App', components: { VueDraggable, }, setup() { const list1 = ref([ { name: 'Joao', id: '1', }, { name: 'Jean', id: '2', }, { name: 'Johanna', id: '3', }, { name: 'Juan'...
今天给大家推荐这款拖拽组件VueDraggablePlus,试了一下非常不错,据说还被尤雨溪推荐过,咱们国人自己开发的,中国人不骗🇨🇳人,我就再来推荐一遍吧。 背后的故事 提到拖拽功能的实现,大家首先想到的几乎都是大名鼎鼎的Sortablejs。 和大家一样,Sortablejs也是我开发时的首选, 由于项目使用的是 Vue3,选择了Sortable...
在Sortablejs官方以往的Vue组件中,都是通过使用组件作为列表的直接子元素来实现拖拽列表,当我们使用一些组件库时,如果组件库中没有提供列表根元素的插槽,我们很难实现拖拽列表,vue-draggable-plus 完美解决了这个问题,它可以让你在任何元素上使用拖拽列表,我们可以使用指定元素的选择器,来获取到列表根元素,然后将列表根...
When we use some component libraries, if there is no slot for the root element of the list in the component library , it is difficult for us to implement a drag list, vue-draggable-plus perfectly solves this problem, it allows you to use a drag list on any element, we can use the ...
VueDraggablePlus 是一个专为 Vue 打造的拖拽排序模块,基于 Sortablejs 封装,支持 Vue3 或 Vue 2.7+,本月的 21 日,Vue 作者尤雨溪还在社交媒体上推荐了这款组件。If you are looking for a drag-and-drop library for Vue (both 2 and 3), this one looks really good。 如果你想找一...
VueDraggablePlus是一个专为 Vue 打造的拖拽排序模块,基于 Sortablejs 封装,支持 Vue3 或 Vue 2.7+。前不久,Vue 作者尤雨溪还在社交媒体上推荐了这款组件。 If you are looking for a drag-and-drop library for Vue (both 2 and 3), this one looks really good。 如果你想找一个 Vue 2 和 Vue 3 ...