@gurinder/vue-confirm

1.0.3 • Public • Published

@gurinder/vue-confirm

Installation & Usage

    <vue-confirm></vue-confirm>
import Confirm from '@gurinder/vue-confirm';
Vue.component('vue-confirm', Confirm);

Vue.prototype.$confirm = (message, confirmText, cancelText) => {
    return new Promise((resolve, reject) => {
        window.Event.fire("confirm", {
            message: message,
            confirmText: confirmText,
            cancelText: cancelText,
            resolve: resolve,
            reject: reject
        })
    })
};
// Use in vue instance
this.$confirm("Are you ready to delete")


// Bind confirm to vue instance to use like confirm("Are you ready to delete")
const VueApp = new Vue({
    el: '#app'
})

window.confirm = message => VueApp.$confirm(message);

Readme

Keywords

none

Package Sidebar

Install

npm i @gurinder/vue-confirm

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

13.9 kB

Total Files

9

Last publish

Collaborators

  • gurinder