Skip to content

Commit 2162bca

Browse files
update documentation
1 parent 238c077 commit 2162bca

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

example/components/handler.vue

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<template>
22
<div class="justify-content-center jumbotron">
33
<div class="row">
4-
<div class="col-8">
4+
<div class="col-1">
5+
<button class="btn btn-secondary button" @click="add">Add</button>
6+
</div>
7+
8+
<div class="col-7">
59
<h3>Draggable {{ draggingInfo }}</h3>
610

711
<draggable
@@ -12,12 +16,14 @@
1216
>
1317
<li
1418
class="list-group-item"
15-
v-for="element in list"
19+
v-for="(element, idx) in list"
1620
:key="element.name"
1721
>
1822
<i class="fa fa-align-justify handle"></i>
1923

2024
{{ element.name }}
25+
26+
<i class="fa fa-times close" @click="removeAt(idx)"></i>
2127
</li>
2228
</draggable>
2329
</div>
@@ -28,6 +34,7 @@
2834
</template>
2935

3036
<script>
37+
let id = 3;
3138
import draggable from "@/vuedraggable";
3239
import rawDisplayer from "./raw-displayer.vue";
3340
export default {
@@ -50,14 +57,26 @@ export default {
5057
draggingInfo() {
5158
return this.dragging ? "under drag" : "";
5259
}
60+
},
61+
methods: {
62+
removeAt(idx) {
63+
this.list.splice(idx, 1);
64+
},
65+
add: function() {
66+
id++;
67+
this.list.push({ name: "Juan " + id, id });
68+
}
5369
}
5470
};
5571
</script>
5672
<style scoped>
57-
.buttons {
58-
margin-top: 50px;
73+
.button {
74+
margin-top: 35px;
5975
}
6076
.handle {
6177
float: left;
6278
}
79+
.close {
80+
float: right;
81+
}
6382
</style>

example/components/simple.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ export default {
7373
</script>
7474
<style scoped>
7575
.buttons {
76-
margin-top: 50px;
76+
margin-top: 35px;
7777
}
7878
</style>

example/components/transition-example-2.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default {
9393

9494
<style>
9595
.button {
96-
margin-top: 50px;
96+
margin-top: 35px;
9797
}
9898
9999
.flip-list-move {

example/components/transition-example.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default {
8989

9090
<style>
9191
.button {
92-
margin-top: 50px;
92+
margin-top: 35px;
9393
}
9494
9595
.flip-list-move {

0 commit comments

Comments
 (0)