Refactored, added es5 build

This commit is contained in:
euvl
2017-04-05 11:34:38 +01:00
parent 5109f89848
commit 3d9c97722f
15 changed files with 10570 additions and 117 deletions

28
src/index.js Normal file
View File

@@ -0,0 +1,28 @@
import Vue from 'vue'
import Modal from './Modal.vue'
const ModalPlugin = {
install(Vue, options = {}) {
if (!this.hasOwnProperty("event")) {
this.event = new Vue()
}
const $modal = {
show(name, params) {
ModalPlugin.event.$emit('toggle', name, true, params)
},
hide(name, params) {
ModalPlugin.event.$emit('toggle', name, false, params)
}
}
Object.defineProperty(Vue.prototype, '$modal', {
get: () => $modal
})
Vue.component('modal', Modal)
return null
},
}
export default ModalPlugin