Components
BaseConfirmDialog
A confirmation dialog for destructive or important actions, with an optional typed confirmation.
components/ui/BaseConfirmDialog.vue
View in the demo
Example
Each button opens the dialog through useConfirm() and prints the answer. The last one asks you to type DELETE.
API
Props
Name | Type | Default | Description |
|---|---|---|---|
titlerequired | string | — | The question. |
message | string | — | The consequence. |
confirm-label | string | — | The confirm button text: say what happens (“Delete project”). |
cancel-label | string | — | The cancel button text. |
tone | "primary" | "error" | "warning" | "info" | "success" | "primary" | primary, error, warning, info or success. |
icon | string | — | An icon tile. |
icon-color | string | — | Overrides the icon colour. |
confirm-text | string | — | A word the user must type before confirming. |
confirm-disabled | boolean | false | Blocks the confirm button, for example while a requirement is not met. |
v-model | boolean | false | Whether it is open. |
Slots
Name | Slot props | Description |
|---|---|---|
#default | — | Extra content under the message, such as a list of consequences. |
#actions-start | — | An action on the left of the footer. |
Events
Name | Payload | Description |
|---|---|---|
@update:modelValue | [value: boolean] | — |
@confirm | — | The user confirmed. |
@cancel | — | The user cancelled or closed it. |