[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8693":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},8693,"vue-draggable-plus","Alfred-Skyblue\u002Fvue-draggable-plus","Alfred-Skyblue","Universal Drag-and-Drop Component Supporting both Vue 3 and Vue 2","https:\u002F\u002Fvue-draggable-plus.pages.dev\u002Fen\u002F",null,"Vue",4000,177,18,102,0,1,3,15,63.75,"MIT License",false,"main",true,[26,27,28,29,30,31,32,33,34],"composition-api","drag","drag-and-drop","draggable","sortablejs","typescript","vue","vue2","vue3","2026-06-12 04:00:40","\u003Cp align=\"center\">\u003Cimg src=\".\u002Fdocs\u002Fpublic\u002Flogo.svg\" alt=\"\">\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fvue-draggable-plus\" target=\"__blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fvue-draggable-plus?color=a1b858&label=\" alt=\"NPM version\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fvue-draggable-plus\" target=\"__blank\">\u003Cimg alt=\"NPM Downloads\" src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdm\u002Fvue-draggable-plus?color=50a36f&label=\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Falfred-skyblue.github.io\u002Fvue-draggable-plus\u002Fen\u002F\" target=\"__blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=&message=docs%20%26%20demos&color=1e8a7a\" alt=\"Docs & Demos\">\u003C\u002Fa>\n\u003Cbr>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Falfred-skyblue\u002Fvue-draggable-plus\" target=\"__blank\">\u003Cimg alt=\"GitHub stars\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Falfred-skyblue\u002Fvue-draggable-plus?style=social\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n# vue-draggable-plus\n\n[中文文档](https:\u002F\u002Fvue-draggable-plus.pages.dev\u002F)\n\n\nDrag and drop sorting module, support Vue>=v3 or Vue>=2.7\n\n[Example of use](https:\u002F\u002Fstackblitz.com\u002Fedit\u002Fgithub-b2xatc-qe8qxj?file=src%2FApp.vue)\n\n## Describe\n\nSince the `vue3` component of `Sortablejs` has not been updated, it has been seriously out of touch with `vue3`, so this project was born. This component is based on `Sortablejs`, so if you want to know more about `Sortablejs`, you can check it out [`Sortablejs` official website](https:\u002F\u002Fgithub.com\u002FSortableJS\u002FSortable)\n\nWe have encapsulated a variety of usages for this, you can use components, function, or instructions, there is always one that suits you\n\n## Solve pain points\n\nIn `Sortablejs` official `Vue` components in the past, the drag-and-drop list is implemented by using the component as a direct child element of the list. 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 selector of the specified element to get the root element of the list, and then Use the root element of the list as `container` of `Sortablejs`, for details, refer to [specify target container](\u002Fsrc\u002F__docs__\u002Ftarget-container\u002F).\n\n\n## Install\n\n```bash\n\nnpm install vue-draggable-plus\n\n```\n\n## Usage\n\n### Component usage\n\n```vue\n\u003Ctemplate>\n    \u003CVueDraggable ref=\"el\" v-model=\"list\">\n      \u003Cdiv v-for=\"item in list\" :key=\"item.id\">\n        {{ item.name }}\n      \u003C\u002Fdiv>\n    \u003C\u002FVueDraggable>\n\u003C\u002Ftemplate>\n\n\u003Cscript setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { VueDraggable } from 'vue-draggable-plus'\n\nconst list = ref([\n  {\n    name: 'Joao',\n    id: 1\n  },\n  {\n    name: 'Jean',\n    id: 2\n  },\n  {\n    name: 'Johanna',\n    id: 3\n  },\n  {\n    name: 'Juan',\n    id: 4\n  }\n])\n\u003C\u002Fscript>\n```\n\n### Function Usage\n\n```vue\n\u003Ctemplate>\n  \u003Cdiv ref=\"el\">\n    \u003Cdiv v-for=\"item in list\" :key=\"item.id\">\n      {{ item.name }}\n    \u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n\n\u003Cscript setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { useDraggable } from 'vue-draggable-plus'\n\nconst el = ref\u003CHTMLElement | null>(null)\nconst list = ref([\n  {\n    name: 'Joao',\n    id: 1\n  },\n  {\n    name: 'Jean',\n    id: 2\n  },\n  {\n    name: 'Johanna',\n    id: 3\n  },\n  {\n    name: 'Juan',\n    id: 4\n  }\n])\n\u002F\u002F The return value is an object, which contains some methods, such as start, destroy, pause, etc.\nconst draggable = useDraggable(el, list, {\n  animation: 150,\n  onStart() {\n    console.log('start')\n  },\n  onUpdate() {\n    console.log('update')\n  }\n})\n\u003C\u002Fscript>\n```\n\n### Directive Usage\n\n```vue\n\u003Ctemplate>\n  \u003Cdiv\n    v-draggable=\"[\n        list,\n        {\n          animation: 150,\n        }\n      ]\"\n  >\n    \u003Cdiv v-for=\"item in list\" :key=\"item.id\">\n      {{ item.name }}\n    \u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n\n\u003Cscript setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { vDraggable } from 'vue-draggable-plus'\nconst list = ref([\n  {\n    name: 'Joao',\n    id: 1\n  },\n  {\n    name: 'Jean',\n    id: 2\n  },\n  {\n    name: 'Johanna',\n    id: 3\n  },\n  {\n    name: 'Juan',\n    id: 4\n  },\n  {\n    name: 'Yuan',\n    id: 5\n  }\n])\n\nfunction onStart() {\n  console.log('start')\n}\n\nfunction onUpdate() {\n  console.log('update')\n}\n\u003C\u002Fscript>\n```\n\n\n\n## Explanation\n\nAll event functions starting with `on` can be passed to components using `v-on`. For example:\n\n```vue\n\n\u003Ctemplate>\n  \u003CVueDraggable v-model=\"list\" @start=\"onStart\" @end=\"onEnd\">\u003C\u002FVueDraggable>\n\u003C\u002Ftemplate>\n\u003Cscript lang=\"ts\" setup>\nimport { ref } from \"vue\";\nimport { VueDraggable } from 'vue-draggable-plus'\nimport { SortableEvent } from \"sortablejs\";\n\nconst list = ref([\n  {\n    name: 'Joao',\n    id: '1'\n  },\n  {\n    name: 'Jean',\n    id: '2'\n  },\n  {\n    name: 'Johanna',\n    id: '3'\n  },\n  {\n    name: 'Juan',\n    id: '4'\n  }\n])\n\nfunction onStart(event: SortableEvent) {\n  console.log('start drag')\n}\n\nfunction onEnd(event: SortableEvent) {\n  console.log('end drag')\n}\n\u003C\u002Fscript>\n\n```\n\n> For information on using Hooks and directives, please refer to the documentation.\n\n## Options\n\n`Options` inherits all configuration items from `Sortablejs`. For details, please see the [`Sortablejs` official documentation](https:\u002F\u002Fgithub.com\u002FSortableJS\u002FSortable).\n\n### Types\n```ts\ntype Easing =\n  | 'steps(int, start | end)'\n  | 'cubic-bezier(n, n, n, n)'\n  | 'linear'\n  | 'ease'\n  | 'ease-in'\n  | 'ease-out'\n  | 'ease-in-out'\n  | 'step-start'\n  | 'step-end'\n  | 'initial'\n  | 'inherit'\n\ntype PullResult = ReadonlyArray\u003Cstring> | boolean | 'clone';\ntype PutResult = ReadonlyArray\u003Cstring> | boolean;\n\ninterface GroupOptions {\n  \u002F**\n   * Group name.\n   *\u002F\n  name: string;\n  \u002F**\n   * The ability to move from the list. Clone - copy the item instead of moving it.\n   *\u002F\n  pull?: PullResult | ((to: Sortable, from: Sortable, dragEl: HTMLElement, event: SortableEvent) => PullResult) | undefined;\n  \u002F**\n   * Whether elements can be added from other lists, or an array of group names from which elements can be obtained.\n   *\u002F\n  put?: PutResult | ((to: Sortable, from: Sortable, dragEl: HTMLElement, event: SortableEvent) => PutResult) | undefined;\n  \u002F**\n   * After moving to another list, the cloned element is restored to its initial position.\n   *\u002F\n  revertClone?: boolean | undefined;\n}\n\ntype Group = string | GroupOptions | undefined;\n\ntype ScrollFn = ((\n        this: Sortable,\n        offsetX: number,\n        offsetY: number,\n        originalEvent: Event,\n        touchEvt: TouchEvent,\n        hoverTargetEl: HTMLElement,\n    ) => 'continue' | void) | undefined;\n```\n\n## API\n\n| Parameter                | Description                                                                                 | Type                                                  | Default              |\n|-------------------------|---------------------------------------------------------------------------------------------|-------------------------------------------------------|----------------------|\n| animation               | Show animation while dragging                                                               | `Number`                                              | 0                     |\n| chosenClass             | CSS class name for chosen item                                                              | `String`                                              | 'sortable-chosen'     |\n| delay                   | Delay in milliseconds before drag starts                                                    | `Number`                                              | 0                     |\n| delayOnTouchOnly        | Delay on touch event                                                                        | `Boolean`                                              | false                     |\n| direction               | Dragging direction, 'vertical' or 'horizontal' (default auto detect)                         | `String`                                              | -                     |\n| disabled                | Disable dragging                                                                            | `Boolean`                                             | false                 |\n| dragClass               | CSS class name for dragged item                                                              | `String`                                              | 'sortable-drag'       |\n| draggable               | Selector for draggable items within element                                                  | `String`                                              | -                     |\n| emptyInsertThreshold    | Distance (in pixels) from empty sortable items where dragging element should be inserted. Set to `0` to disable this feature.  | `Number`                                              | 5                     |\n| easing                  | Animation easing                                                                            | `Easing`                                              | -                     |\n| fallbackClass           | CSS class name for cloned DOM elements when using forceFallback                               | `String`                                              | `sortable-fallback`   |\n| fallbackOnBody          | Append cloned DOM element to body element                                                    | `Boolean`                                             | `false`               |\n| fallbackTolerance       | Pixels mouse must move before drag start when using forceFallback                             | `Number`                                              | 0                     |\n| filter                  | Selector for items that should not be draggable                                               | `String`                                              | -                     |\n| forceFallback           | Ignore HTML5 drag and drop behavior and force fallback                                        | `Boolean`                                             | `false`               |\n| ghostClass              | CSS class name for drop placeholder                                                          | `String`                                              | 'sortable-ghost'      |\n| group                   | Group items to drag between sortable lists. Both lists must have the same `group` value. Also define whether lists can be dragged out of, cloned, or receive elements from other lists. See TypeScript type definition above for details. | `Group`                                               | -                     |\n| handle                  | Selector for handle to initiate drag. If not set, the target element's children are used        | `String`                                              | -                     |\n| invertSwap              | Always use inverted swap zone if set to true                                                  | `Boolean`                                             | `false`               |\n| invertedSwapThreshold   | Inverted swap zone threshold, defaults to `swapThreshold` value                                | `Number`                                              | -                     |\n| preventOnFilter         | Call `event.preventDefault()` on filter event                                                | `Boolean`                                             | `true`                |\n| removeCloneOnHide       | Remove instead of hiding cloned element when not displayed                                     | `Boolean`                                             | `true`                |\n| sort                    | Allow list items to be sorted within container                                                 | `Boolean`                                             | `true`                |\n| swapThreshold           | Swap zone threshold                                                                         | `Number`                                              | 1                     |\n| touchStartThreshold     | Pixels before cancelling delay touch event                                                   | `Number`                                              | 1                     |\n| setData                 | Pass a function where the first argument is of type `DataTransfer` and the second argument is of type `HTMLElement` | `Function`                                            | -                     |\n| scroll                  | Enable scrolling                                                                            | `Boolean`                                             | `HTMLElement`         | `true`                |\n| scrollFn                | Custom scroll function                                                                      | `ScrollFn`                                            | -                     |\n| scrollSensitivity     | The distance in pixels the mouse must be to the edge to start scrolling                | `Number`                                             | -                    |\n| scrollSpeed           | The scrolling speed in ms\u002Fpx                                                          | `number`                                             | -                    |\n| bubbleScroll          | Enables automatic scrolling for all parent elements to make it easier to move items   | `Boolean`                                            | `true`               |\n| onChoose              | Triggered when an item is selected                                                      | `((event: SortableEvent) => void)`                   | -                    |\n| onUnchoose            | Triggered when an item is deselected                                                    | `((event: SortableEvent) => void)`                   | -                    |\n| onStart               | Triggered when an item is picked up for drag and drop                                    | `((event: SortableEvent) => void)`                   | -                    |\n| onEnd                 | Triggered when an item is no longer being dragged                                       | `((event: SortableEvent) => void)`                   | -                    |\n| onAdd                 | Triggered when an item is moved from one list to another                                 | `((event: SortableEvent) => void)`                   | -                    |\n| onUpdate              | Triggered when the order of the items is updated                                        | `((event: SortableEvent) => void)`                   | -                    |\n| onSort                | Triggered whenever any changes are made to the list                                     | `((event: SortableEvent) => void)`                   | -                    |\n| onRemove              | Triggered when an item is removed from the list and moved to another                     | `((event: SortableEvent) => void)`                   | -                    |\n| onFilter              | Triggered when trying to drag a filtered item                                            | `((event: SortableEvent) => void)`                   | -                    |\n| onMove                | Triggered while an item is being dragged                                                | `((event: MoveEvent,originalEvent: Event) => void)`   | -                    |\n| onClone               | Triggered when an item is cloned                                                         | `((event: SortableEvent) => void)`                   | -                    |\n| onChange              | Triggered when an item is dragged and changes position                                   | `((event: SortableEvent) => void)`                   | -                    |\n","vue-draggable-plus 是一个支持 Vue 3 和 Vue 2 的通用拖放组件。它基于 Sortablejs，提供了多种使用方式，包括组件、函数或指令，以满足不同需求。该项目解决了在某些组件库中难以实现拖放列表的问题，通过指定目标容器，使得任何元素都可以作为拖放列表的根元素。适用于需要灵活拖放排序功能的场景，如任务管理、项目规划等。",2,"2026-06-11 03:19:19","top_language"]