This commit is contained in:
yev
2018-02-22 22:01:27 +00:00
parent 087ee92993
commit 27084b8801
4 changed files with 31 additions and 25 deletions

18
dist/index.js vendored
View File

@@ -631,15 +631,15 @@
}, },
methods: { methods: {
add: function(modal, params, config) { 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({ this.modals.push({
id: id, id: id,
name: name,
component: modal, component: modal,
params: params || {}, params: params || {},
config: config || {} config: config
}), this.$nextTick(function() { }), this.$nextTick(function() {
_this.$modal.show(name); _this.$modal.show(config.name);
}); });
}, },
remove: function(id) { remove: function(id) {
@@ -791,16 +791,18 @@
}, _vm._l(_vm.modals, function(modal) { }, _vm._l(_vm.modals, function(modal) {
return _c("modal", _vm._b({ return _c("modal", _vm._b({
key: modal.id, key: modal.id,
attrs: {
name: modal.name
},
on: { on: {
closed: function($event) { closed: function($event) {
_vm.remove(modal.id); _vm.remove(modal.id);
} }
} }
}, "modal", modal.config, !1), [ _c(modal.component, _vm._b({ }, "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); }, "component", modal.params, !1)) ], 1);
})); }));
}, },

18
dist/ssr.index.js vendored
View File

@@ -585,15 +585,15 @@
}, },
methods: { methods: {
add: function(modal, params, config) { 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({ this.modals.push({
id: id, id: id,
name: name,
component: modal, component: modal,
params: params || {}, params: params || {},
config: config || {} config: config
}), this.$nextTick(function() { }), this.$nextTick(function() {
_this.$modal.show(name); _this.$modal.show(config.name);
}); });
}, },
remove: function(id) { remove: function(id) {
@@ -745,16 +745,18 @@
}, _vm._l(_vm.modals, function(modal) { }, _vm._l(_vm.modals, function(modal) {
return _c("modal", _vm._b({ return _c("modal", _vm._b({
key: modal.id, key: modal.id,
attrs: {
name: modal.name
},
on: { on: {
closed: function($event) { closed: function($event) {
_vm.remove(modal.id); _vm.remove(modal.id);
} }
} }
}, "modal", modal.config, !1), [ _c(modal.component, _vm._b({ }, "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); }, "component", modal.params, !1)) ], 1);
})); }));
}, },

18
dist/ssr.nocss.js vendored
View File

@@ -522,15 +522,15 @@
}, },
methods: { methods: {
add: function(modal, params, config) { 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({ this.modals.push({
id: id, id: id,
name: name,
component: modal, component: modal,
params: params || {}, params: params || {},
config: config || {} config: config
}), this.$nextTick(function() { }), this.$nextTick(function() {
_this.$modal.show(name); _this.$modal.show(config.name);
}); });
}, },
remove: function(id) { remove: function(id) {
@@ -676,16 +676,18 @@
}, _vm._l(_vm.modals, function(modal) { }, _vm._l(_vm.modals, function(modal) {
return _c("modal", _vm._b({ return _c("modal", _vm._b({
key: modal.id, key: modal.id,
attrs: {
name: modal.name
},
on: { on: {
closed: function($event) { closed: function($event) {
_vm.remove(modal.id); _vm.remove(modal.id);
} }
} }
}, "modal", modal.config, !1), [ _c(modal.component, _vm._b({ }, "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); }, "component", modal.params, !1)) ], 1);
})); }));
}, },

View File

@@ -1,7 +1,7 @@
{ {
"name": "vue-js-modal", "name": "vue-js-modal",
"description": "Modal Component for Vue.js", "description": "Modal Component for Vue.js",
"version": "1.3.11", "version": "1.3.12",
"author": "euvl <yev.vlasenko@gmail.com>", "author": "euvl <yev.vlasenko@gmail.com>",
"main": "dist/index.js", "main": "dist/index.js",
"repository": { "repository": {