vd
vue2-dnd
npm i vue2-dnd
vd

vue2-dnd

Drag n' Drop plugin for Vue.js

by 白熱

1.0.1 (see all)License:MITTypeScript:Not Found
npm i vue2-dnd
Readme

vue2-dnd

img img

Drag n' Drop plugin for Vue.js

Demo

jsfiddle

Installation

npm install vue2-dnd --save

Usage

import Vue2Dnd from 'vue2-dnd'

Vue.use(Vue2Dnd)

Draggable Directive

v-draggable.[groupname]="[draggable object]"
<template>
  <div v-draggable.groupname="item"></div>
</template>

<script>
  export default {
    data () {
      return {
        key: item.key,
        name: item.name
      }
    }
  }
</script>

Droppable Directive

v-droppable.[groupname]="[droppable callback function]"
<template>
  <div v-droppable.groupname="callback"></div>
</template>

<script>
  export default {
    methods: {
      callback ($ev) {
        // $ev contains the draggable object
      }
    }
  }
</script>

License

MIT

Downloads/wk

25

GitHub Stars

12

LAST COMMIT

5yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
1.0.1
latest
5yrs ago
No alternatives found
No tutorials found
Add a tutorial