You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
__A more practical use of ths `v-confirm` directive inside a loop__
137
+
__A more practical use of ths `v-confirm` directive inside a loop - Solution 1__
118
138
119
139
```html
120
140
// While looping through users
@@ -144,6 +164,41 @@ methods: {
144
164
}
145
165
```
146
166
167
+
168
+
__( new ) A more practical use of ths `v-confirm` directive inside a loop - Solution 2__
169
+
170
+
```html
171
+
// While looping through users
172
+
<buttonv-for="user in users"
173
+
:data-user="user"
174
+
v-confirm="{
175
+
loader: true,
176
+
ok: makeAdmin,
177
+
cancel: doNothing,
178
+
message: 'User will be given admin privileges. Make user an Admin?'}"
179
+
>
180
+
Make Admin
181
+
</button>
182
+
```
183
+
```javascript
184
+
methods: {
185
+
makeAdmin:function(dialog) {
186
+
let button =dialog.node// node is only available if triggered via a directive
187
+
let user =button.dataset.user
188
+
189
+
// Make user admin from the backend
190
+
/* tellServerToMakeAdmin(user) */
191
+
192
+
// When completed, close the dialog
193
+
/* dialog.close() */
194
+
195
+
},
196
+
doNothing:function() {
197
+
// Do nothing or some other stuffs
198
+
}
199
+
}
200
+
```
201
+
147
202
__For v-confirm directive, if an "OK" callback is not provided, the default event would be triggered.__
148
203
149
204
```html
@@ -185,6 +240,7 @@ let options = {
185
240
verificationHelp:'Type "[+:verification]" below to confirm', // Verification help text. [+:verification] will be matched with 'options.verification' (i.e 'Type "continue" below to confirm')
186
241
clicksCount:3, // for soft confirm, user will be asked to click on "proceed" btn 3 times before actually proceeding
187
242
backdropClose:false// set to true to close the dialog when clicking outside of the dialog window, i.e. click landing on the mask
243
+
customClass:''// Custom class to be injected into the parent node for the current dialog instance
188
244
};
189
245
190
246
this.$dialog.confirm(message, options)
@@ -214,7 +270,7 @@ Vue.use(VuejsDialog, {
214
270
215
271
### CSS Override
216
272
217
-
Please use basic css, ex:
273
+
If you have included the plugin's style and wish to make a few overides, you can do so with basic css, ex:
0 commit comments