Skip to content

Commit 69cf8c4

Browse files
Using atttrs for options
1 parent 0e53faa commit 69cf8c4

12 files changed

+107
-58
lines changed

example/components/clone.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<draggable
66
class="dragArea list-group"
77
:list="list1"
8-
:options="{ group: { name: 'people', pull: 'clone', put: false } }"
8+
:group="{ name: 'people', pull: 'clone', put: false }"
99
@change="log"
1010
>
1111
<div
@@ -23,7 +23,7 @@
2323
<draggable
2424
class="dragArea list-group"
2525
:list="list2"
26-
:options="{ group: 'people' }"
26+
group="people"
2727
@change="log"
2828
>
2929
<div

example/components/custom-clone.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<draggable
66
class="dragArea list-group"
77
:list="list1"
8-
:options="{ group: { name: 'people', pull: 'clone', put: false } }"
8+
:group="{ name: 'people', pull: 'clone', put: false }"
99
:clone="cloneDog"
1010
@change="log"
1111
>
@@ -20,7 +20,7 @@
2020
<draggable
2121
class="dragArea list-group"
2222
:list="list2"
23-
:options="{ group: 'people' }"
23+
group="people"
2424
@change="log"
2525
>
2626
<div class="list-group-item" v-for="element in list2" :key="element.id">

example/components/footerslot.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<draggable
77
:list="list"
88
class="list-group"
9-
:options="{ draggable: '.item' }"
9+
draggable=".item"
1010
@start="dragging = true"
1111
@end="dragging = false"
1212
>

example/components/handle.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
element="ul"
1212
:list="list"
1313
class="list-group"
14-
:options="{ handle: '.handle' }"
14+
handle=".handle"
1515
>
1616
<li
1717
class="list-group-item"

example/components/headerslot.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<draggable
77
:list="list"
88
class="list-group"
9-
:options="{ draggable: '.item' }"
9+
draggable=".item"
1010
@start="dragging = true"
1111
@end="dragging = false"
1212
>

example/components/infra/nested.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
<template>
2-
<draggable
3-
class="dragArea"
4-
:element="'ul'"
5-
:list="tasks"
6-
:options="{ group: { name: 'g1' } }"
7-
>
2+
<draggable class="dragArea" :element="'ul'" :list="tasks" :group="{ name: 'g1' }">
83
<li v-for="el in tasks" :key="el.name">
94
<p>{{ el.name }}</p>
10-
<nested-draggable :tasks="el.tasks" />
5+
<nested-draggable :tasks="el.tasks"/>
116
</li>
127
</draggable>
138
</template>

example/components/simple.vue

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
<template>
22
<div class="row">
33
<div class="col-2">
4-
<div
5-
class="btn-group-vertical buttons"
6-
role="group"
7-
aria-label="Basic example"
8-
>
9-
<button class="btn btn-secondary" @click="add">Add</button>
10-
<button class="btn btn-secondary" @click="replace">Replace</button>
4+
<div class="form-group">
5+
<div
6+
class="btn-group-vertical buttons"
7+
role="group"
8+
aria-label="Basic example"
9+
>
10+
<button class="btn btn-secondary" @click="add">Add</button>
11+
<button class="btn btn-secondary" @click="replace">Replace</button>
12+
</div>
13+
14+
<div class="form-check">
15+
<input
16+
id="disabled"
17+
type="checkbox"
18+
v-model="disabled"
19+
class="form-check-input"
20+
/>
21+
<label class="form-check-label" for="disabled">Disable DnD</label>
22+
</div>
1123
</div>
1224
</div>
1325

@@ -16,6 +28,7 @@
1628

1729
<draggable
1830
:list="list"
31+
:disabled="disabled"
1932
class="list-group"
2033
@start="dragging = true"
2134
@end="dragging = false"
@@ -46,6 +59,7 @@ export default {
4659
},
4760
data() {
4861
return {
62+
disabled: false,
4963
list: [
5064
{ name: "John", id: 0 },
5165
{ name: "Joao", id: 1 },

example/components/table-column-example..vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
<table class="table table-striped">
77
<thead class="thead-dark">
88
<draggable v-model="headers" element="tr">
9-
<th v-for="header in headers" :key="header" scope="col">
10-
{{ header }}
11-
</th>
9+
<th v-for="header in headers" :key="header" scope="col">{{ header }}</th>
1210
</draggable>
1311
</thead>
14-
<tr v-for="item in list" :key="item.name">
15-
<td v-for="header in headers" :key="header">{{ item[header] }}</td>
16-
</tr>
12+
<tbody>
13+
<tr v-for="item in list" :key="item.name">
14+
<td v-for="header in headers" :key="header">{{ item[header] }}</td>
15+
</tr>
16+
</tbody>
1717
</table>
1818
</div>
1919

20-
<rawDisplayer class="col-2" :value="list" title="List" />
20+
<rawDisplayer class="col-2" :value="list" title="List"/>
2121

22-
<rawDisplayer class="col-2" :value="headers" title="Headers" />
22+
<rawDisplayer class="col-2" :value="headers" title="Headers"/>
2323
</div>
2424
</template>
2525

example/components/transition-example-2.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class="list-group"
1313
element="ul"
1414
v-model="list"
15-
:options="dragOptions"
15+
v-bind="dragOptions"
1616
@start="drag = true"
1717
@end="drag = false"
1818
>

example/components/transition-example.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class="list-group"
1313
element="ul"
1414
v-model="list"
15-
:options="dragOptions"
15+
v-bind="dragOptions"
1616
@start="isDragging = true"
1717
@end="isDragging = false"
1818
>

0 commit comments

Comments
 (0)