forked from SortableJS/Vue.Draggable
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82b2282
commit 4e78454
Showing
5 changed files
with
121 additions
and
6 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<template> | ||
|
||
<div class=" justify-content-center jumbotron"> | ||
|
||
<div class="row"> | ||
<div class="col-3"> | ||
<h3>Draggable for list 1</h3> | ||
<draggable | ||
class="dragArea list-group" | ||
:list="list1" | ||
:options="{group:{name:'people', pull:'clone', put:false }}" | ||
@change="log" | ||
> | ||
<div | ||
class="list-group-item" | ||
v-for="(element, index) in list1" | ||
:key="element.name" | ||
> | ||
{{element.name}} {{index}} | ||
</div> | ||
</draggable> | ||
</div> | ||
|
||
<div class="col-3"> | ||
<h3>Draggable for list 2</h3> | ||
<draggable | ||
class="dragArea list-group" | ||
:list="list2" | ||
:options="{group:'people'}" | ||
@change="log" | ||
> | ||
<div | ||
class="list-group-item" | ||
v-for="(element, index) in list2" | ||
:key="element.name" | ||
> | ||
{{element.name}} {{index}} | ||
</div> | ||
</draggable> | ||
</div> | ||
|
||
<rawDisplayer | ||
class="col-3" | ||
:value="list1" | ||
title="List 1" | ||
/> | ||
|
||
<rawDisplayer | ||
class="col-3" | ||
:value="list2" | ||
title="List 2" | ||
/> | ||
|
||
</div> | ||
|
||
</div> | ||
</template> | ||
|
||
<script> | ||
import draggable from "@/components/Vuedraggable"; | ||
import rawDisplayer from "./raw-displayer.vue"; | ||
let id = 1; | ||
export default { | ||
name: "clone", | ||
components: { | ||
draggable, | ||
rawDisplayer | ||
}, | ||
data() { | ||
return { | ||
list1: [ | ||
{ name: "John", id: 1 }, | ||
{ name: "Joao", id: 2 }, | ||
{ name: "Jean", id: 3 }, | ||
{ name: "Gerard", id: 4 } | ||
], | ||
list2: [ | ||
{ name: "Juan", id: 5 }, | ||
{ name: "Edgard", id: 6 }, | ||
{ name: "Johnson", id: 7 } | ||
] | ||
}; | ||
}, | ||
methods: { | ||
log: function(evt) { | ||
console.log(evt); | ||
} | ||
} | ||
}; | ||
</script> | ||
<style scoped> | ||
</style> | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
</template> | ||
<script> | ||
const props = { | ||
name: "raw-displayer", | ||
title: { | ||
required: true, | ||
type: String | ||
|
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
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