import Confirm from './vuetify-confirm.component' function install (Vue, options) { const property = (options && options.property) || '$confirm' function createDialogCmp (options) { return new Promise((resolve) => { const cmp = new Vue(Object.assign({}, Confirm, { propsData: Object.assign({}, Vue.prototype.$confirm.options, options), destroyed: (c) => { document.body.removeChild(cmp.$el) resolve(cmp.value) } })) console.log(cmp.$mount()) // document.body.appendChild(cmp.$mount().$el) }) } function show (message, options = {}) { options.message = message return createDialogCmp(options) } Vue.prototype[property] = show Vue.prototype[property].options = options || {} } export default { install }