vue-confirm-button-gmlo
v0.1.4
Published
Button to request confirm before execute an action
Downloads
20
Readme
VueConfirmButton
Introduction
Button to request confirm before execute an action using SweetAlert2
Installation
npm i --save vue-confirm-button-gmlo
Usage
import VueConfirmButton from "vue-confirm-button-gmlo";
Vue.component('VueConfirmButton', VueConfirmButton);
<vue-confirm-button dialog-title="Do you confirm delete this item?">Delete</vue-confirm-button>
Props
| Props | Type | Required | Default | | --------------------------- | ----------------- | -------- | --------------------------- | | dialog-title | String | yes | - | | dialog-text | String | no | - | | confirm-button-text | String | no | "Yes" | | cancel-button-text | String | no | "Cancel" |
You can inherit attributes directly to the button, example:
<!-- Use bootstrap classes on button and disabled-->
<vue-confirm-button class="btn btn-danger" disabled dialog-title="Do you confirm delete this item?">Delete</vue-confirm-button>
Events
| Event | Description | | -------- | ---------------- | | confirmed | When the user to click on confirm button | | canceled | When the user to click on cancel button or exit from the dialog |