Skip to content

Commit 44a4062

Browse files
Update Readme
1 parent 60a6ed4 commit 44a4062

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,20 @@ Use draggable component:
6464
</draggable>
6565
```
6666
67-
6867
Draggable component should directly wrap the draggable elements, or a `transition-component` containing the draggable elements.
6968
7069
70+
### With footer slot:
71+
``` html
72+
<draggable v-model="myArray" :options="{draggable:'.item'}">
73+
<div v-for="element in myArray" :key="element.id" class="item">
74+
{{element.name}}
75+
</div>
76+
<button slot="footer" @click="addPeople">Add</button>
77+
</draggable>
78+
```
79+
80+
7181
### With Vuex:
7282
7383
```html
@@ -199,6 +209,20 @@ HTML:
199209
- `oldIndex`: the old index of the moved element
200210
- `element`: the moved element
201211
212+
### Slots
213+
Use the `footer` slot to add none-draggable element inside the vuedraggable component.
214+
Important: it should be used in conjunction with draggable option to tag draggable element.
215+
Ex:
216+
217+
``` html
218+
<draggable v-model="myArray" :options="{draggable:'.item'}">
219+
<div v-for="element in myArray" :key="element.id" class="item">
220+
{{element.name}}
221+
</div>
222+
<button slot="footer" @click="addPeople">Add</button>
223+
</draggable>
224+
```
225+
202226
### Gotchas
203227
- Drag operation with empty list:
204228

0 commit comments

Comments
 (0)