All Projects → Vivify-Ideas → Vue Draggable

Vivify-Ideas / Vue Draggable

Licence: mit
Vue Drag and Drop library without any dependency 👌

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Draggable

ember-dragula
Simple drag and drop with dragula and ember
Stars: ✭ 27 (-89.53%)
Mutual labels:  drag-and-drop
DragBoardView
⭐ Android 看板,支持项拖拽、列拖拽。Draggable kanban/board view for Android.
Stars: ✭ 85 (-67.05%)
Mutual labels:  drag-and-drop
vue-simple-upload-component
A simple upload component for Vue.js 2.x
Stars: ✭ 14 (-94.57%)
Mutual labels:  drag-and-drop
KDRearrangeableCollectionViewFlowLayout
A Drag and Rearrange UICollectionView through its layout
Stars: ✭ 73 (-71.71%)
Mutual labels:  drag-and-drop
vite-vue3-lowcode
vue3.x + vite2.x + vant + element-plus H5移动端低代码平台 lowcode 可视化拖拽 可视化编辑器 visual editor 类似易企秀的H5制作、建站工具、可视化搭建工具
Stars: ✭ 1,309 (+407.36%)
Mutual labels:  drag-and-drop
viiny-dragger
viiny-dragger is a drag and drop plugin for javascript.
Stars: ✭ 27 (-89.53%)
Mutual labels:  drag-and-drop
v-drag-drop
Minimalistic drag & drop directives for Vue.js
Stars: ✭ 17 (-93.41%)
Mutual labels:  drag-and-drop
DraggableTreeView
TreeView with drag and drop (n-th level)
Stars: ✭ 95 (-63.18%)
Mutual labels:  drag-and-drop
nested-sort
Nested Sort is a JavaScript library which helps you to sort a nested list of items via drag and drop.
Stars: ✭ 31 (-87.98%)
Mutual labels:  drag-and-drop
FancyAdapters
A collection of customizable RecyclerView Adapters for Android, that provide various functionality like item selection, contextual action mode controls, drag&drop and swiping, among other.
Stars: ✭ 49 (-81.01%)
Mutual labels:  drag-and-drop
rc-dock
Dock Layout for React Component
Stars: ✭ 318 (+23.26%)
Mutual labels:  drag-and-drop
recycler-adapter
RecyclerView-driven declarative UIs
Stars: ✭ 124 (-51.94%)
Mutual labels:  drag-and-drop
yii2-dropzone
This extension provides the Dropzone integration for the Yii2 framework.
Stars: ✭ 11 (-95.74%)
Mutual labels:  drag-and-drop
Limg
An image hosting service powered by Laravel
Stars: ✭ 41 (-84.11%)
Mutual labels:  drag-and-drop
splitImage
把图片分割成n*m份,支持拖拽、input上传
Stars: ✭ 22 (-91.47%)
Mutual labels:  drag-and-drop
dragulaR
No description or website provided.
Stars: ✭ 62 (-75.97%)
Mutual labels:  drag-and-drop
jquery-xhr-upload-queue
📂 A jQuery queued file uploading plugin.
Stars: ✭ 17 (-93.41%)
Mutual labels:  drag-and-drop
Handygridview
HandyGridView是一个高仿支付宝,网易新闻的高性能的标签可拖动排序的GridView。
Stars: ✭ 255 (-1.16%)
Mutual labels:  drag-and-drop
image-uploader
Simple Drag & Drop image uploader plugin to static forms, without using AJAX
Stars: ✭ 70 (-72.87%)
Mutual labels:  drag-and-drop
recyclerview-list-drag-and-drop
No description or website provided.
Stars: ✭ 50 (-80.62%)
Mutual labels:  drag-and-drop

npm version vue2 GitHub open issues npm download MIT License

Description

Vue Drag and Drop library without any dependency.

Native HTML5 drag and drop implementation made for Vue.

Examples 🎪

Installation

npm install vue-draggable
<!-- or -->
yarn add vue-draggable

Setup

Setup plugin

import Vue from 'vue'
import VueDraggable from 'vue-draggable'

Vue.use(VueDraggable)

Setup directive locally

import { VueDraggableDirective } from 'vue-draggable'

export default {
  directives: {
    dragAndDrop: VueDraggableDirective
  }
}

Usage

In the template, use the v-drag-and-drop directive:

HTML

<div v-drag-and-drop:options="options">
  <ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
  </ul>
  <ul>
      <li>Item 4</li>
      <li>Item 5</li>
      <li>Item 6</li>
  </ul>
</div>

Options

Directive v-drag-and-drop available options

{
  dropzoneSelector: 'ul',
  draggableSelector: 'li',
  handlerSelector: null,
  reactivityEnabled: true,
  multipleDropzonesItemsDraggingEnabled: true,
  showDropzoneAreas: true,
  onDrop: function(event) {},
  onDragstart: function(event) {},
  onDragenter: function(event) {},
  onDragover: function(event) {},
  onDragend: function(event) {}
}

Dropzone events (added, removed, reordered)

<div v-drag-and-drop:options="options">
  <ul
    @added="added"
    @removed="removed"
    @reordered="reordered"
  >
    <li data-id="1">Item 1</li>
    <li data-id="2">Item 2</li>
    <li data-id="3">Item 3</li>
  </ul>
</div>

These three custom events have additional ids and index params. Ids is an array of defined data-id attributes and index represents drop intersection. For more info check out example

Reactivity handling and renderless component

There is available VueDraggableGroup component so you don't need to write your own model manipulation logic. However, usage of this component is optional. Use only with Vue v2.6+. You can pass to component optional itemsKey prop if you want to change items collection property name. By default it's items.

<div v-drag-and-drop:options="options">
  <!-- optional renderless component -->
  <vue-draggable-group
    v-for="group in groups"
    v-model="group.items"
    :groups="groups"
    :key="group.id"
    :data-id="group.id"
    @change="onGroupsChange"
  >
    <ul>
      <li
        v-for="item in group.items"
        :key="item.id"
        :data-id="item.id"
      >
        <label v-text="item.name"></label>
      </li>
    </ul>
  </vue-draggable-group>
</div>

Event Params for onDrop, onDragstart, onDragenter, onDragover, onDragend callbacks

{
  nativeEvent: {}, // native js event
  items: [], // list of selected draggable elements
  owner: null, // old dropzone element
  droptarget: null // new dropzone element,
  stop: () => {} // Stop D&D (available only for callbacks `onDragstart` and `onDragend`)
}

TypeScript

Included TypeScript definitions.

Browser Compatibility

Polyfills for IE9+ support are included in the repo.

If you need to support IE9 in your applications, import the polyfills:

import 'vue-draggable/polyfills'

Contributors 🎖

nikolasp tiagocsilva piboistudios swaroopjo figurluk
nikolasp tiagocsilva piboistudios swaroopjo figurluk

LICENCE MIT - Created by Nikola Spalevic ([email protected])

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].