Skip to content

Commit f21b6e2

Browse files
Adding migration steps
1 parent 3c606ed commit f21b6e2

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

documentation/migrate.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
## Element props
2+
3+
`element` has been deprecated and you should use `tag` props instead. The motivation is to comply with widespread convention.
4+
5+
Migrate from:
6+
7+
```HTML
8+
<draggable element="ul">
9+
<li v-for="element in list" :key="element.id">{{element.name}}</li>
10+
</draggable>
11+
```
12+
13+
To:
14+
15+
```HTML
16+
<draggable tag="ul">
17+
<li v-for="element in list" :key="element.id">{{element.name}}</li>
18+
</draggable>
19+
```
20+
21+
## Options props
22+
23+
`options` props has been deprecated in version v2.20.
24+
25+
Vue.draggable starting from that release will use [transparent wrapper](https://zendev.com/2018/05/31/transparent-wrapper-components-in-vue.html) to pass props to the Sortable instance.
26+
27+
28+
So [Sortable options](https://github.com/SortableJS/Sortable#options) can directly be attached to Vue.draggable instance.
29+
30+
Example 1:
31+
32+
Migrate from:
33+
34+
```HTML
35+
<draggable v-for="list" :options="{handle: '.handle'}">
36+
<!-- -->
37+
</draggable>
38+
```
39+
40+
To:
41+
42+
```HTML
43+
<draggable v-for="list" handle=".handle">
44+
<!-- -->
45+
</draggable>
46+
```
47+
48+
Example 2:
49+
50+
Migrate from:
51+
52+
```HTML
53+
<draggable v-for="list" :options="getOptions()">
54+
<!-- -->
55+
</draggable>
56+
```
57+
58+
To:
59+
60+
```HTML
61+
<draggable v-for="list" v-bind="getOptions()">
62+
<!-- -->
63+
</draggable>
64+
```
65+
66+
67+
68+

0 commit comments

Comments
 (0)