From 27084b88016b10362175c9b53e44702c8ce2c2a4 Mon Sep 17 00:00:00 2001 From: yev Date: Thu, 22 Feb 2018 22:01:27 +0000 Subject: [PATCH] v1.3.12 --- dist/index.js | 18 ++++++++++-------- dist/ssr.index.js | 18 ++++++++++-------- dist/ssr.nocss.js | 18 ++++++++++-------- package.json | 2 +- 4 files changed, 31 insertions(+), 25 deletions(-) diff --git a/dist/index.js b/dist/index.js index 2616c5d..23b5e4a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -631,15 +631,15 @@ }, methods: { add: function(modal, params, config) { - var _this = this, id = this.uid++, name = "_dynamic-modal-" + id; + var _this = this, id = this.uid++; + config = config ? Object.assign({}, config) : {}, config.name || (config.name = "_dynamic-modal-" + id), this.modals.push({ id: id, - name: name, component: modal, params: params || {}, - config: config || {} + config: config }), this.$nextTick(function() { - _this.$modal.show(name); + _this.$modal.show(config.name); }); }, remove: function(id) { @@ -791,16 +791,18 @@ }, _vm._l(_vm.modals, function(modal) { return _c("modal", _vm._b({ key: modal.id, - attrs: { - name: modal.name - }, on: { closed: function($event) { _vm.remove(modal.id); } } }, "modal", modal.config, !1), [ _c(modal.component, _vm._b({ - tag: "component" + tag: "component", + on: { + close: function($event) { + _vm.$modal.hide(modal.config.name); + } + } }, "component", modal.params, !1)) ], 1); })); }, diff --git a/dist/ssr.index.js b/dist/ssr.index.js index 22f526e..fb15955 100644 --- a/dist/ssr.index.js +++ b/dist/ssr.index.js @@ -585,15 +585,15 @@ }, methods: { add: function(modal, params, config) { - var _this = this, id = this.uid++, name = "_dynamic-modal-" + id; + var _this = this, id = this.uid++; + config = config ? Object.assign({}, config) : {}, config.name || (config.name = "_dynamic-modal-" + id), this.modals.push({ id: id, - name: name, component: modal, params: params || {}, - config: config || {} + config: config }), this.$nextTick(function() { - _this.$modal.show(name); + _this.$modal.show(config.name); }); }, remove: function(id) { @@ -745,16 +745,18 @@ }, _vm._l(_vm.modals, function(modal) { return _c("modal", _vm._b({ key: modal.id, - attrs: { - name: modal.name - }, on: { closed: function($event) { _vm.remove(modal.id); } } }, "modal", modal.config, !1), [ _c(modal.component, _vm._b({ - tag: "component" + tag: "component", + on: { + close: function($event) { + _vm.$modal.hide(modal.config.name); + } + } }, "component", modal.params, !1)) ], 1); })); }, diff --git a/dist/ssr.nocss.js b/dist/ssr.nocss.js index 05dad23..0a359e3 100644 --- a/dist/ssr.nocss.js +++ b/dist/ssr.nocss.js @@ -522,15 +522,15 @@ }, methods: { add: function(modal, params, config) { - var _this = this, id = this.uid++, name = "_dynamic-modal-" + id; + var _this = this, id = this.uid++; + config = config ? Object.assign({}, config) : {}, config.name || (config.name = "_dynamic-modal-" + id), this.modals.push({ id: id, - name: name, component: modal, params: params || {}, - config: config || {} + config: config }), this.$nextTick(function() { - _this.$modal.show(name); + _this.$modal.show(config.name); }); }, remove: function(id) { @@ -676,16 +676,18 @@ }, _vm._l(_vm.modals, function(modal) { return _c("modal", _vm._b({ key: modal.id, - attrs: { - name: modal.name - }, on: { closed: function($event) { _vm.remove(modal.id); } } }, "modal", modal.config, !1), [ _c(modal.component, _vm._b({ - tag: "component" + tag: "component", + on: { + close: function($event) { + _vm.$modal.hide(modal.config.name); + } + } }, "component", modal.params, !1)) ], 1); })); }, diff --git a/package.json b/package.json index b54560c..d00b4a9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vue-js-modal", "description": "Modal Component for Vue.js", - "version": "1.3.11", + "version": "1.3.12", "author": "euvl ", "main": "dist/index.js", "repository": {