Skip to content

Instantly share code, notes, and snippets.

@c01nd01r c01nd01r/drag.vue
Created Jan 15, 2017

Embed
What would you like to do?
vue draggable
<template>
<div class="hello">
<draggable :list="list" :options="{animation: 150}" >
<div v-for="element in list" class="element">{{element.name}}</div>
</draggable>
</div>
</template>
<script>
import draggable from 'vuedraggable';
export default {
name: 'hello',
data() {
return {
list: [
{ name: 'Line 0' },
{ name: 'Line 1' },
{ name: 'Line 2' },
{ name: 'Line 3' },
{ name: 'Line 4' },
],
};
},
components: {
draggable,
},
};
</script>
<style type="text/css">
.element {
box-shadow: 1px 1px 1px 0px #e2e2e2;
width: 300px;
margin: 0 auto;
border: 1px solid #ccc;
margin-bottom: 5px;
padding: 10px;
cursor: move;
background: #35495e;
color: #fff;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.