Skip to content

Commit 3837ef0

Browse files
WIP
1 parent 4e78454 commit 3837ef0

File tree

7 files changed

+40
-96
lines changed

7 files changed

+40
-96
lines changed

example/App.vue

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
<template>
22
<div id="app">
3-
<img
4-
alt="Vue logo"
5-
src="./assets/logo.png"
6-
>
3+
<img alt="Vue logo" src="./assets/logo.png" />
74
<div class="container ">
8-
9-
<ul
10-
class="nav nav-tabs"
11-
role="tablist"
12-
>
5+
<ul class="nav nav-tabs" role="tablist">
136
<li class="nav-item">
147
<a
158
class="nav-link active"
@@ -18,55 +11,51 @@
1811
role="tab"
1912
aria-controls="profile"
2013
aria-selected="true"
21-
>Simple</a>
14+
>Simple</a
15+
>
2216
</li>
2317

24-
<li class="nav-item">
18+
<li class="nav-item">
2519
<a
2620
class="nav-link"
2721
data-toggle="tab"
2822
href="#twoLists"
2923
role="tab"
3024
aria-controls="profile"
3125
aria-selected="false"
32-
>Two Lists</a>
26+
>Two Lists</a
27+
>
3328
</li>
3429

35-
<li class="nav-item">
30+
<li class="nav-item">
3631
<a
3732
class="nav-link"
3833
data-toggle="tab"
3934
href="#clone"
4035
role="tab"
4136
aria-controls="profile"
4237
aria-selected="false"
43-
>Clone</a>
38+
>Clone</a
39+
>
4440
</li>
45-
4641
</ul>
47-
<div
48-
class="tab-content"
49-
id="tab-content"
50-
>
51-
42+
<div class="tab-content" id="tab-content">
5243
<div
5344
class="tab-pane show active"
5445
id="simple"
5546
role="tabpanel"
5647
aria-labelledby="profile-tab"
5748
>
5849
<simple />
59-
6050
</div>
6151

62-
<div
52+
<div
6353
class="tab-pane show"
6454
id="twoLists"
6555
role="tabpanel"
6656
aria-labelledby="profile-tab"
6757
>
6858
<twoLists />
69-
7059
</div>
7160

7261
<div
@@ -76,10 +65,7 @@
7665
aria-labelledby="profile-tab"
7766
>
7867
<clone />
79-
8068
</div>
81-
82-
8369
</div>
8470
</div>
8571
</div>

example/components/clone.vue

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
<template>
2-
32
<div class=" justify-content-center jumbotron">
4-
53
<div class="row">
64
<div class="col-3">
75
<h3>Draggable for list 1</h3>
86
<draggable
97
class="dragArea list-group"
108
:list="list1"
11-
:options="{group:{name:'people', pull:'clone', put:false }}"
9+
:options="{ group: { name: 'people', pull: 'clone', put: false } }"
1210
@change="log"
1311
>
1412
<div
1513
class="list-group-item"
1614
v-for="(element, index) in list1"
1715
:key="element.name"
1816
>
19-
{{element.name}} {{index}}
17+
{{ element.name }} {{ index }}
2018
</div>
2119
</draggable>
2220
</div>
@@ -26,40 +24,29 @@
2624
<draggable
2725
class="dragArea list-group"
2826
:list="list2"
29-
:options="{group:'people'}"
27+
:options="{ group: 'people' }"
3028
@change="log"
3129
>
3230
<div
3331
class="list-group-item"
3432
v-for="(element, index) in list2"
3533
:key="element.name"
3634
>
37-
{{element.name}} {{index}}
35+
{{ element.name }} {{ index }}
3836
</div>
3937
</draggable>
4038
</div>
4139

42-
<rawDisplayer
43-
class="col-3"
44-
:value="list1"
45-
title="List 1"
46-
/>
47-
48-
<rawDisplayer
49-
class="col-3"
50-
:value="list2"
51-
title="List 2"
52-
/>
40+
<rawDisplayer class="col-3" :value="list1" title="List 1" />
5341

42+
<rawDisplayer class="col-3" :value="list2" title="List 2" />
5443
</div>
55-
5644
</div>
5745
</template>
5846

5947
<script>
6048
import draggable from "@/components/Vuedraggable";
6149
import rawDisplayer from "./raw-displayer.vue";
62-
let id = 1;
6350
export default {
6451
name: "clone",
6552
components: {
@@ -83,11 +70,9 @@ export default {
8370
},
8471
methods: {
8572
log: function(evt) {
86-
console.log(evt);
73+
window.console.log(evt);
8774
}
8875
}
8976
};
9077
</script>
91-
<style scoped>
92-
</style>
93-
78+
<style scoped></style>

example/components/raw-displayer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div>
3-
<h3>{{title}}</h3>
4-
<pre>{{valueString}}</pre>
3+
<h3>{{ title }}</h3>
4+
<pre>{{ valueString }}</pre>
55
</div>
66
</template>
77
<script>

example/components/simple.vue

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,38 @@
11
<template>
22
<div class="justify-content-center jumbotron">
33
<div class="row">
4-
54
<div class="col-2">
65
<div
76
class="btn-group-vertical buttons"
87
role="group"
98
aria-label="Basic example"
109
>
11-
<button
12-
class="btn btn-secondary"
13-
@click="add"
14-
>Add</button>
15-
<button
16-
class="btn btn-secondary"
17-
@click="replace"
18-
>Replace</button>
19-
10+
<button class="btn btn-secondary" @click="add">Add</button>
11+
<button class="btn btn-secondary" @click="replace">Replace</button>
2012
</div>
2113
</div>
2214

2315
<div class="col-6">
24-
<h3>Draggable {{draggingInfo}}</h3>
16+
<h3>Draggable {{ draggingInfo }}</h3>
2517

2618
<draggable
2719
:list="list"
2820
class="list-group"
29-
@start="dragging=true"
30-
@end="dragging=false"
21+
@start="dragging = true"
22+
@end="dragging = false"
3123
>
3224
<div
3325
class="list-group-item"
3426
v-for="element in list"
3527
:key="element.name"
36-
>{{element.name}}</div>
28+
>
29+
{{ element.name }}
30+
</div>
3731
</draggable>
3832
</div>
3933

40-
<rawDisplayer
41-
class="col-3"
42-
:value="list"
43-
title="List"
44-
/>
45-
34+
<rawDisplayer class="col-3" :value="list" title="List" />
4635
</div>
47-
4836
</div>
4937
</template>
5038

@@ -88,4 +76,3 @@ export default {
8876
margin-top: 50px;
8977
}
9078
</style>
91-

example/components/two-lists.vue

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
<template>
22
<div class=" justify-content-center jumbotron">
3-
43
<div class="row">
54
<div class="col-3">
65
<h3>Draggable for list 1</h3>
76
<draggable
87
class="dragArea list-group"
98
:list="list1"
10-
:options="{group:'people'}"
9+
:options="{ group: 'people' }"
1110
@change="log"
1211
>
1312
<div
1413
class="list-group-item"
1514
v-for="(element, index) in list1"
1615
:key="element.name"
1716
>
18-
{{element.name}} {{index}}
17+
{{ element.name }} {{ index }}
1918
</div>
2019
</draggable>
2120
</div>
@@ -25,35 +24,24 @@
2524
<draggable
2625
class="dragArea list-group"
2726
:list="list2"
28-
:options="{group:'people'}"
27+
:options="{ group: 'people' }"
2928
@change="log"
3029
>
3130
<div
3231
class="list-group-item"
3332
v-for="(element, index) in list2"
3433
:key="element.name"
3534
>
36-
{{element.name}} {{index}}
35+
{{ element.name }} {{ index }}
3736
</div>
3837
</draggable>
3938
</div>
4039

41-
<rawDisplayer
42-
class="col-3"
43-
:value="list1"
44-
title="List 1"
45-
/>
46-
47-
<rawDisplayer
48-
class="col-3"
49-
:value="list2"
50-
title="List 2"
51-
/>
40+
<rawDisplayer class="col-3" :value="list1" title="List 1" />
5241

42+
<rawDisplayer class="col-3" :value="list2" title="List 2" />
5343
</div>
54-
5544
</div>
56-
5745
</template>
5846
<script>
5947
import draggable from "@/components/Vuedraggable";
@@ -93,7 +81,7 @@ export default {
9381
};
9482
},
9583
log: function(evt) {
96-
console.log(evt);
84+
window.console.log(evt);
9785
}
9886
}
9987
};
@@ -103,4 +91,3 @@ export default {
10391
min-height: 10px;
10492
}
10593
</style>
106-

example/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import Vue from "vue";
2-
import App from "./App.vue";
2+
import App from "./App.vue";
33
import "bootstrap/dist/css/bootstrap.min.css";
44
require("bootstrap");
55

6-
76
Vue.config.productionTip = false;
87

98
new Vue({

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"scripts": {
88
"serve": "vue-cli-service serve ./example/main.js --open",
99
"build": "vue-cli-service build --name vuedraggable --entry ./src/index.js --target lib",
10-
"lint": "vue-cli-service lint",
10+
"lint": "vue-cli-service lint src example",
1111
"prepublishOnly": "npm run lint && npm run build",
1212
"test:unit": "vue-cli-service test:unit"
1313
},

0 commit comments

Comments
 (0)