@@ -28,7 +28,7 @@ https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-action
28
28
<docs >
29
29
### Single action
30
30
31
- ```
31
+ ```vue
32
32
<template>
33
33
<NcActions>
34
34
<NcActionButton @click="actionDelete">
@@ -57,7 +57,7 @@ export default {
57
57
58
58
### Multiple actions
59
59
60
- ```
60
+ ```vue
61
61
<template>
62
62
<NcActions>
63
63
<NcActionButton @click="showMessage('Edit')">
@@ -102,7 +102,7 @@ export default {
102
102
103
103
### Multiple actions with 2 items inline
104
104
105
- ```
105
+ ```vue
106
106
<template>
107
107
<NcActions :inline="2">
108
108
<NcActionButton @click="showMessage('Add')">
@@ -155,7 +155,7 @@ export default {
155
155
156
156
### Multiple actions with custom icon
157
157
158
- ```
158
+ ```vue
159
159
<template>
160
160
<NcActions>
161
161
<template #icon>
@@ -203,7 +203,7 @@ export default {
203
203
204
204
### With menu title
205
205
206
- ```
206
+ ```vue
207
207
<template>
208
208
<NcActions menu-title="Object management">
209
209
<template #icon>
@@ -253,7 +253,7 @@ export default {
253
253
```
254
254
255
255
### Various icons styles
256
- ```
256
+ ```vue
257
257
<template>
258
258
<NcActions :primary="true">
259
259
<NcActionButton>
@@ -283,7 +283,7 @@ export default {
283
283
</script>
284
284
```
285
285
286
- ```
286
+ ```vue
287
287
<template>
288
288
<NcActions :primary="true" menu-title="Object management">
289
289
<template #icon>
@@ -337,7 +337,7 @@ export default {
337
337
### Custom icon slot
338
338
To be used with `vue-material-design-icons` only. For icon classes use the `default-icon` slot.
339
339
It can be used with one or multiple actions.
340
- ```
340
+ ```vue
341
341
<template>
342
342
<div style="display: flex;align-items: center;">
343
343
<NcButton @click="toggled = !toggled">Toggle multiple action</NcButton>
@@ -381,7 +381,7 @@ export default {
381
381
```
382
382
383
383
### Custom icon slot in child elements
384
- ```
384
+ ```vue
385
385
<template>
386
386
<NcActions :primary="true">
387
387
<NcActionButton>
@@ -413,22 +413,22 @@ export default {
413
413
414
414
### Type variants
415
415
416
- ```
416
+ ```vue
417
417
<template>
418
418
<div>
419
419
<NcActions :type="current">
420
420
<template #icon>
421
421
<SelectColor :size="20" />
422
422
</template>
423
423
424
- <NcActionButton v-if="current" close-after-click @click="define(undefined )">
424
+ <NcActionButton v-if="current" close-after-click @click="define()">
425
425
<template #icon>
426
426
<Delete :size="20" />
427
427
</template>
428
428
Remove
429
429
</NcActionButton>
430
430
431
- <NcActionButton close-after-click @click="define(row)" v-for="row in types " :key="`type-icon--${row}`">
431
+ <NcActionButton v-for="row in types" close-after-click @click="define(row)" :key="`type-icon--${row}`">
432
432
<template #icon>
433
433
<CheckboxMarkedCircleOutline v-if="row === current" :size="20" />
434
434
<SelectColor v-else :size="20" />
@@ -438,14 +438,14 @@ export default {
438
438
</NcActions>
439
439
440
440
<NcActions :type="current" menu-title="Choose a type">
441
- <NcActionButton v-if="current" close-after-click @click="define(undefined )">
441
+ <NcActionButton v-if="current" close-after-click @click="define()">
442
442
<template #icon>
443
443
<Delete :size="20" />
444
444
</template>
445
445
Remove
446
446
</NcActionButton>
447
447
448
- <NcActionButton close-after-click @click="define(row)" v-for="row in types " :key="`type-text--${row}`">
448
+ <NcActionButton v-for="row in types" close-after-click @click="define(row)" :key="`type-text--${row}`">
449
449
<template #icon>
450
450
<CheckboxMarkedCircleOutline v-if="row === current" :size="20" />
451
451
<SelectColor v-else :size="20" />
@@ -459,14 +459,14 @@ export default {
459
459
<SelectColor :size="20" />
460
460
</template>
461
461
462
- <NcActionButton v-if="current" close-after-click @click="define(undefined )">
462
+ <NcActionButton v-if="current" close-after-click @click="define()">
463
463
<template #icon>
464
464
<Delete :size="20" />
465
465
</template>
466
466
Remove
467
467
</NcActionButton>
468
468
469
- <NcActionButton close-after-click @click="define(row)" v-for="row in types " :key="`type-icon-text--${row}`">
469
+ <NcActionButton v-for="row in types" close-after-click @click="define(row)" :key="`type-icon-text--${row}`">
470
470
<template #icon>
471
471
<CheckboxMarkedCircleOutline v-if="row === current" :size="20" />
472
472
<SelectColor v-else :size="20" />
@@ -504,7 +504,7 @@ export default {
504
504
}
505
505
},
506
506
methods: {
507
- define(row) {
507
+ define(row = undefined ) {
508
508
this.current = row
509
509
}
510
510
}
0 commit comments