File tree Expand file tree Collapse file tree 3 files changed +184
-1
lines changed Expand file tree Collapse file tree 3 files changed +184
-1
lines changed Original file line number Diff line number Diff line change 38
38
>Clone</a
39
39
>
40
40
</li >
41
+
42
+ <li class =" nav-item" >
43
+ <a
44
+ class =" nav-link"
45
+ data-toggle =" tab"
46
+ href =" #footerslot"
47
+ role =" tab"
48
+ aria-controls =" profile"
49
+ aria-selected =" false"
50
+ >Footer slot</a
51
+ >
52
+ </li >
53
+
54
+ <li class =" nav-item" >
55
+ <a
56
+ class =" nav-link"
57
+ data-toggle =" tab"
58
+ href =" #headerlot"
59
+ role =" tab"
60
+ aria-controls =" profile"
61
+ aria-selected =" false"
62
+ >Header slot</a
63
+ >
64
+ </li >
41
65
</ul >
66
+
42
67
<div class =" tab-content" id =" tab-content" >
43
68
<div
44
69
class =" tab-pane show active"
66
91
>
67
92
<clone />
68
93
</div >
94
+
95
+ <div
96
+ class =" tab-pane show"
97
+ id =" footerslot"
98
+ role =" tabpanel"
99
+ aria-labelledby =" profile-tab"
100
+ >
101
+ <footerslot />
102
+ </div >
103
+
104
+ <div
105
+ class =" tab-pane show"
106
+ id =" headerlot"
107
+ role =" tabpanel"
108
+ aria-labelledby =" profile-tab"
109
+ >
110
+ <headerslot />
111
+ </div >
69
112
</div >
70
113
</div >
71
114
</div >
75
118
import simple from " ./components/simple" ;
76
119
import twoLists from " ./components/two-lists" ;
77
120
import clone from " ./components/clone" ;
121
+ import footerslot from " ./components/footerslot" ;
122
+ import headerslot from " ./components/headerslot" ;
78
123
79
124
export default {
80
125
name: " app" ,
81
126
components: {
82
127
simple,
83
128
twoLists,
84
- clone
129
+ clone,
130
+ footerslot,
131
+ headerslot
85
132
}
86
133
};
87
134
</script >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" justify-content-center jumbotron" >
3
+ <div class =" row" >
4
+ <div class =" col-8" >
5
+ <h3 >Draggable with footer</h3 >
6
+
7
+ <draggable
8
+ :list =" list"
9
+ class =" list-group"
10
+ @start =" dragging = true"
11
+ @end =" dragging = false"
12
+ >
13
+ <div
14
+ class =" list-group-item"
15
+ v-for =" element in list"
16
+ :key =" element.name"
17
+ >
18
+ {{ element.name }}
19
+ </div >
20
+
21
+ <div
22
+ slot =" footer"
23
+ class =" btn-group list-group-item"
24
+ role =" group"
25
+ aria-label =" Basic example"
26
+ >
27
+ <button class =" btn btn-secondary" @click =" add" >Add</button >
28
+ <button class =" btn btn-secondary" @click =" replace" >Replace</button >
29
+ </div >
30
+ </draggable >
31
+ </div >
32
+
33
+ <rawDisplayer class =" col-3" :value =" list" title =" List" />
34
+ </div >
35
+ </div >
36
+ </template >
37
+
38
+ <script >
39
+ import draggable from " @/vuedraggable" ;
40
+ import rawDisplayer from " ./raw-displayer.vue" ;
41
+ let id = 1 ;
42
+ export default {
43
+ name: " footer" ,
44
+ components: {
45
+ draggable,
46
+ rawDisplayer
47
+ },
48
+ data () {
49
+ return {
50
+ list: [
51
+ { name: " John" , id: 0 },
52
+ { name: " Joao" , id: 1 },
53
+ { name: " Jean" , id: 2 }
54
+ ],
55
+ dragging: false
56
+ };
57
+ },
58
+ methods: {
59
+ add : function () {
60
+ this .list .push ({ name: " Juan " + id, id: id++ });
61
+ },
62
+ replace : function () {
63
+ this .list = [{ name: " Edgard" , id: id++ }];
64
+ }
65
+ }
66
+ };
67
+ </script >
68
+ <style scoped></style >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" justify-content-center jumbotron" >
3
+ <div class =" row" >
4
+ <div class =" col-8" >
5
+ <h3 >Draggable with header</h3 >
6
+
7
+ <draggable
8
+ :list =" list"
9
+ class =" list-group"
10
+ @start =" dragging = true"
11
+ @end =" dragging = false"
12
+ >
13
+ <div
14
+ class =" list-group-item"
15
+ v-for =" element in list"
16
+ :key =" element.name"
17
+ >
18
+ {{ element.name }}
19
+ </div >
20
+
21
+ <div
22
+ slot =" header"
23
+ class =" btn-group list-group-item"
24
+ role =" group"
25
+ aria-label =" Basic example"
26
+ >
27
+ <button class =" btn btn-secondary" @click =" add" >Add</button >
28
+ <button class =" btn btn-secondary" @click =" replace" >Replace</button >
29
+ </div >
30
+ </draggable >
31
+ </div >
32
+
33
+ <rawDisplayer class =" col-3" :value =" list" title =" List" />
34
+ </div >
35
+ </div >
36
+ </template >
37
+
38
+ <script >
39
+ import draggable from " @/vuedraggable" ;
40
+ import rawDisplayer from " ./raw-displayer.vue" ;
41
+ let id = 1 ;
42
+ export default {
43
+ name: " simple" ,
44
+ components: {
45
+ draggable,
46
+ rawDisplayer
47
+ },
48
+ data () {
49
+ return {
50
+ list: [
51
+ { name: " John" , id: 0 },
52
+ { name: " Joao" , id: 1 },
53
+ { name: " Jean" , id: 2 }
54
+ ],
55
+ dragging: false
56
+ };
57
+ },
58
+ methods: {
59
+ add : function () {
60
+ this .list .push ({ name: " Juan " + id, id: id++ });
61
+ },
62
+ replace : function () {
63
+ this .list = [{ name: " Edgard" , id: id++ }];
64
+ }
65
+ }
66
+ };
67
+ </script >
68
+ <style scoped></style >
You can’t perform that action at this time.
0 commit comments