Added "componentName" param for optional component name (#53)

This commit is contained in:
euvl
2017-07-31 15:06:07 +01:00
parent cd42709c03
commit f981168904
2 changed files with 17 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
import Modal from './Modal.vue'
const defaultComponentName = 'modal'
const Plugin = {
install (Vue, options = {}) {
if (this.installed) {
@@ -23,7 +25,8 @@ const Plugin = {
}
}
Vue.component('modal', Modal)
const componentName = options.componentName || defaultComponentName
Vue.component(componentName, Modal)
}
}