Update ModalsContainer.vue

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

View File

@@ -4,6 +4,7 @@
v-for="modal in modals" v-for="modal in modals"
:key="modal.id" :key="modal.id"
v-bind="modal.config" v-bind="modal.config"
v-on="modal.events"
@closed="remove(modal.id)" @closed="remove(modal.id)"
> >
<component <component
@@ -26,7 +27,7 @@ export default {
this.$modal._setDynamicContainer(this) this.$modal._setDynamicContainer(this)
}, },
methods: { methods: {
add (modal, params, config) { add (modal, params, config, events) {
let id = this.uid++ let id = this.uid++
config = config ? Object.assign({}, config) : {}; config = config ? Object.assign({}, config) : {};
if (!config.name) { if (!config.name) {
@@ -36,7 +37,8 @@ export default {
id: id, id: id,
component: modal, component: modal,
params: params || {}, params: params || {},
config: config config: config,
events: events
}) })
this.$nextTick(() => { this.$nextTick(() => {
this.$modal.show(config.name) this.$modal.show(config.name)