Skip to content

Delete

The Delete component provides a confirmation dialog for destructive actions. It supports button, icon, menu, and popover trigger modes, with optional match-based secondary confirmation.

Button Mode

Renders as a red outline button by default. Clicking opens a confirmation modal.

vue

<TDelete label="Delete Item" @delete="onDelete" />

Icon Mode

Set display-type="icon" to render as an icon-only button, suitable for compact layouts.

vue

<TDelete display-type="icon" @delete="onDelete" />

Set display-type="menu" to render as a menu item, ideal for dropdown actions.

vue

<TDelete display-type="menu" label="Delete User" @delete="onDelete" />

Popover Quick Confirm

Set display-type="popover" to show a lightweight popover confirmation near the button, without opening a full modal.

vue

<TDelete label="Delete" display-type="popover" @delete="onDelete" />

Disabled State

Set disabled to prevent the delete action.

vue

<TDelete label="Cannot delete" disabled />
<TDelete display-type="icon" disabled />

Secondary Confirmation (Match)

Set the match prop to require the user to type a specific word before confirming, preventing accidental deletions.

vue

<TDelete label="Delete important data" match="DELETE" @delete="onDelete" />

Loading State

Use the loading prop to show a spinner on the confirm button during async delete operations.

vue

<TDelete label="Deleting" :loading="true" @delete="onDelete" />

Localization (Locale)

Pass a locale object to customize all text in the modal and popover. Unset fields fall back to English defaults.

vue

<TDelete
  label="删除项目"
  :locale="{
    confirmTitle: '确认删除',
    confirmMessage: '确定要执行此操作吗?',
    confirmLabel: '确认',
    cancelLabel: '取消',
  }"
  @delete="onDelete"
/>

API

Props

PropDescriptionTypeDefault
labelButton / menu textstring'Delete'
sizeIcon size (icon mode only)number24
disabledDisable the delete actionbooleanfalse
displayTypeDisplay style'button' | 'icon' | 'menu' | 'popover''button'
matchSecondary confirmation textstringundefined
loadingLoading statebooleanfalse
localeLocalization objectDeleteLocale{}

DeleteLocale

FieldDescriptionDefault Value
confirmTitleModal title'Confirm Deletion'
confirmMessageConfirmation message'Are you sure you want to proceed?'
irreversibleIrreversible warning'This action cannot be undone.'
popoverConfirmPopover confirmation prefix'Confirm {label}?'
confirmLabelConfirm button text'Confirm'
cancelLabelCancel button text'Cancel'
typeToConfirmMatch prompt (supports HTML)'Type <span class="fw-bold text-danger">{match}</span> to confirm'

Events

EventDescriptionParameters
deleteEmitted when user confirms delete