File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,20 @@ Use draggable component:
64
64
< / draggable>
65
65
` ` `
66
66
67
-
68
67
Draggable component should directly wrap the draggable elements, or a ` transition- component` containing the draggable elements.
69
68
70
69
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
+
71
81
### With Vuex:
72
82
73
83
` ` ` html
@@ -199,6 +209,20 @@ HTML:
199
209
- ` oldIndex` : the old index of the moved element
200
210
- ` element` : the moved element
201
211
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
+
202
226
### Gotchas
203
227
- Drag operation with empty list:
204
228
You can’t perform that action at this time.
0 commit comments