3
3
<ion-header >
4
4
<ion-toolbar >
5
5
<ion-title >{{ modalTitle }}</ion-title >
6
+ <ion-buttons slot =" start" >
7
+ <ion-button @click =" onCancelClicked" >
8
+ <ion-icon slot =" icon-only" :icon =" arrowBack" ></ion-icon >
9
+ </ion-button >
10
+ </ion-buttons >
11
+
12
+ <ion-buttons slot =" end" >
13
+ <ion-button @click =" onDeleteCollectionCliced" >
14
+ <ion-icon slot =" icon-only" :icon =" trash" ></ion-icon >
15
+ </ion-button >
16
+ </ion-buttons >
6
17
</ion-toolbar >
7
18
</ion-header >
8
19
<ion-content class =" ion-padding" >
28
39
</ion-list >
29
40
30
41
<ion-list-header >Paths</ion-list-header >
31
- <ion-item lines =" full" @click =" onAddPathClicked" >Add path</ion-item >
42
+ <ion-item lines =" full" @click =" onAddPathClicked" button
43
+ >Add path</ion-item
44
+ >
32
45
<ion-item lines =" full" v-for =" (path, i) in dialog.paths" :key =" i" >
33
46
<ion-label class =" ion-text-wrap" >
34
47
{{ path.path }}
35
48
</ion-label >
36
- <ion-button slot =" end" @click =" onDeletePathClicked(path)"
49
+ <ion-button fill = " none " slot =" end" @click =" onDeletePathClicked(path)"
37
50
><ion-icon slot =" icon-only" :icon =" trashBin" ></ion-icon
38
51
></ion-button >
39
52
</ion-item >
53
+ <ion-button
54
+ style =" margin-top : 10px "
55
+ color =" success"
56
+ expand =" block"
57
+ @click =" onSubmitClicked"
58
+ >Save</ion-button
59
+ >
40
60
</ion-content >
41
- <ion-footer >
42
- <ion-button @click =" onCancelClicked" >Cancel</ion-button >
43
- <ion-button color =" success" @click =" onSubmitClicked" >{{
44
- dialog.id ? "Update" : "Create"
45
- }}</ion-button >
46
- </ion-footer >
47
61
</ion-page >
48
62
</template >
49
63
<script >
50
64
import { computed , ref } from " vue" ;
51
- import { trashBin } from " ionicons/icons" ;
65
+ import { trashBin , trash , arrowBack } from " ionicons/icons" ;
52
66
import {
53
67
IonPage ,
54
68
IonHeader ,
@@ -60,7 +74,6 @@ import {
60
74
IonSelectOption ,
61
75
IonItem ,
62
76
IonLabel ,
63
- IonFooter ,
64
77
IonButton ,
65
78
IonList ,
66
79
IonListHeader ,
@@ -94,11 +107,16 @@ export default {
94
107
};
95
108
96
109
const onSubmitClicked = () => {
97
- console .log (" Clicked" );
98
- console .log (dialog .value );
99
110
props .modalController .dismiss (dialog .value );
100
111
};
101
112
113
+ const onDeleteCollectionCliced = () => {
114
+ if (confirm (` Delete collection: ${ dialog .value .name } ?` )) {
115
+ dialog .value .deleted = true ;
116
+ props .modalController .dismiss (dialog .value );
117
+ }
118
+ };
119
+
102
120
const onDeletePathClicked = async (item ) => {
103
121
if (" id" in item) {
104
122
if (confirm (` Delete path: ${ item .path } ?` )) {
@@ -131,13 +149,16 @@ export default {
131
149
});
132
150
};
133
151
return {
134
- trashBin ,
152
+ trash ,
135
153
dialog,
136
154
modalTitle,
137
155
onCancelClicked,
138
156
onSubmitClicked,
139
157
onAddPathClicked,
140
158
onDeletePathClicked,
159
+ arrowBack,
160
+ trashBin,
161
+ onDeleteCollectionCliced,
141
162
};
142
163
},
143
164
components: {
@@ -150,7 +171,6 @@ export default {
150
171
IonSelect,
151
172
IonItem,
152
173
IonLabel,
153
- IonFooter,
154
174
IonButton,
155
175
IonSelectOption,
156
176
IonList,
0 commit comments