Update index.js

This commit is contained in:
Luca Degasperi
2018-03-29 14:03:38 +02:00
committed by GitHub
parent 8d99f6bda8
commit 0b05c5a41d

View File

@@ -24,14 +24,14 @@ const Plugin = {
_setDynamicContainer (dynamicContainer) { _setDynamicContainer (dynamicContainer) {
Plugin.dynamicContainer = dynamicContainer Plugin.dynamicContainer = dynamicContainer
}, },
show (modal, paramsOrProps, params) { show (modal, paramsOrProps, params, events = null) {
if (typeof modal === 'string') { if (typeof modal === 'string') {
Plugin.event.$emit('toggle', modal, true, paramsOrProps) Plugin.event.$emit('toggle', modal, true, paramsOrProps)
} else { } else {
if (Plugin.dynamicContainer === null) { if (Plugin.dynamicContainer === null) {
console.warn('[vue-js-modal] In order to render dynamic modals, a <modals-container> component must be present on the page') console.warn('[vue-js-modal] In order to render dynamic modals, a <modals-container> component must be present on the page')
} else { } else {
Plugin.dynamicContainer.add(modal, paramsOrProps, params) Plugin.dynamicContainer.add(modal, paramsOrProps, params, events)
} }
} }
}, },