Skip to content

Commit 79c05cc

Browse files
Add transition to footer slot example
1 parent 20492e5 commit 79c05cc

File tree

3 files changed

+38
-7
lines changed

3 files changed

+38
-7
lines changed

example/components/footerslot.vue

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
<h3>Draggable with footer</h3>
55

66
<draggable
7+
tag="transition-group"
8+
:componentData="componentData"
79
:list="list"
810
class="list-group"
911
draggable=".item"
12+
:animation="100"
1013
@start="dragging = true"
1114
@end="dragging = false"
1215
>
@@ -23,14 +26,25 @@
2326
class="btn-group list-group-item"
2427
role="group"
2528
aria-label="Basic example"
29+
key="footer"
2630
>
27-
<button class="btn btn-secondary" @click="add">Add</button>
28-
<button class="btn btn-secondary" @click="replace">Replace</button>
31+
<button
32+
class="btn btn-secondary"
33+
@click="add"
34+
>Add</button>
35+
<button
36+
class="btn btn-secondary"
37+
@click="replace"
38+
>Replace</button>
2939
</div>
3040
</draggable>
3141
</div>
3242

33-
<rawDisplayer class="col-3" :value="list" title="List" />
43+
<rawDisplayer
44+
class="col-3"
45+
:value="list"
46+
title="List"
47+
/>
3448
</div>
3549
</template>
3650

@@ -51,7 +65,13 @@ export default {
5165
{ name: "Joao", id: 1 },
5266
{ name: "Jean", id: 2 }
5367
],
54-
dragging: false
68+
dragging: false,
69+
componentData: {
70+
props: {
71+
type: "transition",
72+
name: "flip-list"
73+
}
74+
}
5575
};
5676
},
5777
methods: {
@@ -64,4 +84,12 @@ export default {
6484
}
6585
};
6686
</script>
67-
<style scoped></style>
87+
<style scoped>
88+
.flip-list-move {
89+
transition: transform 0.5s;
90+
}
91+
92+
.no-move {
93+
transition: transform 0s;
94+
}
95+
</style>

example/components/transition-example.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@start="isDragging = true"
1717
@end="isDragging = false"
1818
>
19-
<transition-group type="transition" :name="'flip-list'">
19+
<transition-group type="transition" name="flip-list">
2020
<li
2121
class="list-group-item"
2222
v-for="element in list"

src/vuedraggable.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,10 @@ const draggableComponent = {
459459
const draggedContext = this.context;
460460
const futureIndex = this.computeFutureIndex(relatedContext, evt);
461461
Object.assign(draggedContext, { futureIndex });
462-
const sendEvt = Object.assign({}, evt, { relatedContext, draggedContext });
462+
const sendEvt = Object.assign({}, evt, {
463+
relatedContext,
464+
draggedContext
465+
});
463466
return onMove(sendEvt, originalEvent);
464467
},
465468

0 commit comments

Comments
 (0)