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')Label for the built-in Import mass-action button.
exportLabelstring() =&gt; t('nextcloud-vue', 'Export')Label for the built-in Export mass-action button.
copyLabelstring() =&gt; t('nextcloud-vue', 'Copy')Label for the built-in Copy mass-action button.
deleteLabelstring() =&gt; t('nextcloud-vue', 'Delete')Label for the built-in Delete mass-action button.

Events​

NamePayloadDescription
mass-copy—Emitted when the Copy action is clicked. No payload.
mass-delete—Emitted when the Delete action is clicked. No payload.
mass-export—Emitted when the Export action is clicked. No payload.
mass-import—Emitted when the Import action is clicked. No payload.

Slots​

NameBindingsDescription
actionscount, selected-idsactions Additional app-specific mass-action buttons. Slot scope: { count, selectedIds }.