Ga naar hoofdinhoud

CnMassActionBar

Mass action dropdown button for selected items. Appears when items are selected in a table or card grid.

Wraps: NcActions, NcActionButton

Try it

Loading CnMassActionBar playground…

CnMassActionBar showing bulk action options (Import, Export, Copy, Delete)

Props

PropTypeDefaultDescription
selectedIdsArray[]Selected item IDs
countNumber0Number of selected items
showImportBooleantrueShow mass import action
showExportBooleantrueShow mass export action
showCopyBooleantrueShow mass copy action
showDeleteBooleantrueShow mass delete action
menuLabelTemplateString'Mass Actions (\{count\})'
importLabelStringImport action label
exportLabelStringExport action label
copyLabelStringCopy action label
deleteLabelStringDelete action label

Events

EventDescription
mass-importImport action triggered
mass-exportExport action triggered
mass-copyCopy action triggered
mass-deleteDelete action triggered

Slots

SlotScopeDescription
#actions\{ count, selectedIds \}Custom mass action buttons

Usage

<CnMassActionBar
:selected-ids="selected"
:count="selected.length"
@mass-delete="onMassDelete"
@mass-export="onMassExport">
<template #actions="{ count }">
<NcActionButton @click="onCustomAction">
Custom Action ({{ count }})
</NcActionButton>
</template>
</CnMassActionBar>

Reference (auto-generated)

The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnMassActionBar.vue and update automatically whenever the component changes.

Props

NameTypeRequiredDefaultDescription
selectedIdsarray[]Array of selected item IDs
countnumber0Number of selected items
showImportbooleantrueWhether to show the built-in Import action
showExportbooleantrueWhether to show the built-in Export action
showCopybooleantrueWhether to show the built-in Copy action
showDeletebooleantrueWhether to show the built-in Delete action
menuLabelTemplatestring() =&gt; t('nextcloud-vue', 'Mass actions (\{count\})')Label template for the menu button. Use {count} for the count.
importLabelstring() =&gt; t('nextcloud-vue', 'Import')
exportLabelstring() =&gt; t('nextcloud-vue', 'Export')
copyLabelstring() =&gt; t('nextcloud-vue', 'Copy')
deleteLabelstring() =&gt; t('nextcloud-vue', 'Delete')

Events

NamePayloadDescription
mass-import
mass-export
mass-copy
mass-delete

Slots

NameBindingsDescription
actionscount, selected-ids