Skip to content

v-confirm-button ​

Requires a second click to confirm an action. On first click, changes button text to "Confirm". Moving the mouse away resets it.

Listen for @confirm instead of @click.

Usage ​

vue
<!-- Basic usage -->
<button v-confirm-button @confirm="deleteItem">Delete</button>

<!-- Custom confirmation text and class -->
<button v-confirm-button="{ text: 'Really delete?', class: 'confirming' }" @confirm="deleteItem">
    Delete
</button>

<!-- No text change, just require double click -->
<button v-confirm-button="{ text: null }" @confirm="deleteItem">
    Delete
</button>

Options ​

PropertyTypeDefaultDescription
textstring | null'Confirm'Text shown after first click. null keeps original text.
classstring-CSS class added to the button in confirm state

Demo ​