A Pen by Felipe Prieto on CodePen.
Created
December 14, 2020 09:29
-
-
Save savepong/a4d44826b22b5f55ead22525b27de7b7 to your computer and use it in GitHub Desktop.
Sample Multi Drag Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="app"> | |
<v-app id="inspire"> | |
<v-card | |
class="mx-auto" | |
tile | |
> | |
<draggable v-for="(item, index) in images" | |
v-model="images[index]" | |
group="image" | |
animation="150" | |
selected-class="sortableSelected" | |
ghost-class="imageGhost" | |
@change="imagesChanged" | |
tag="v-layout" | |
class="sortableRow imageContainer" | |
:component-data="{row: true}" | |
:force-fallback="true" | |
multi-drag> | |
<v-flex v-for="image in item" class="droppableImage" :key="image.path"> | |
{{image}} | |
</v-flex> | |
</draggable> | |
</v-card> | |
</v-app> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Vue({ | |
el: '#app', | |
vuetify: new Vuetify(), | |
data: () => ({ | |
images: [[ | |
'Real-Time', | |
'Audience', | |
'Conversions', | |
],[ | |
'Real-Time2', | |
'Audience2', | |
'Conversions2', | |
]] | |
}), | |
methods: { | |
imagesChanged(e) { | |
console.log(e) | |
} | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdn.jsdelivr.net/npm/babel-polyfill/dist/polyfill.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.js"></script> | |
<script src="https://cdn.jsdelivr.net/gh/Flip535/Vue.Draggable@be82d2a15f99fc80c0fc836aa8550ff07d943a60/dist/vuedraggable.umd.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.sortableSelected { | |
background-color: yellow; | |
} | |
.imageContainer { | |
border: solid 10px black; | |
padding: 4px; | |
} | |
.droppableImage { | |
border: solid 1px black; | |
margin: 5px; | |
} | |
.imageGhost { | |
background-color: lightblue | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet" /> | |
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet" /> | |
<link href="https://fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet" /> | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment