1.0.5 • Published 4 years ago
vue-confirm-linhdanchu v1.0.5
Installing
Using npm:
$ npm install vue-confirm-linhdanchu --save-dev
Example
this.$confirm('this is message', 'this is title', custom)
//custom is an Object
.then(() => {
// act upon confirmation
}).catch(() => {
// act when not confirmed
})
custom option
Name | Type | All values | Default value | Description |
---|---|---|---|---|
confirmButtonText | String | - | OK | Text for button confirm. |
cancelButtonText | String | - | Cancel | Text for button not confirm. |
type | String | success, warning, error, info, default | default | Color of button confirm (By default, no type is required). |
Example:
// vue cli
import Vue from 'vue';
import vueConfirm from 'vue-confirm-linhdanchu';
import 'vue-confirm-linhdanchu/src/confirm.css';
Vue.use(vueConfirm);
or
//laravel mix + vuejs
window.Vue = require('vue');
require('vue-confirm-linhdanchu');
import 'vue-confirm-linhdanchu/src/confirm.css';
methods: {
showConfirm() {
this.$confirm('this is your message','this is your title', {
confirmButtonText: 'OK',
cancelButtonText: 'Cancel',
type: 'default',
}).then(() => {
// act upon confirmation
}).catch(() => {
// act when not confirmed
});
}
}