mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2025-10-29 18:00:20 +00:00
#178 Clone config argument in modals container to prevent mutating user-supplied arguments
This commit is contained in:
@@ -28,7 +28,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
add (modal, params, config) {
|
add (modal, params, config) {
|
||||||
let id = this.uid++
|
let id = this.uid++
|
||||||
config = config || {};
|
config = config ? Object.assign({}, config) : {};
|
||||||
if (!config.name) {
|
if (!config.name) {
|
||||||
config.name = '_dynamic-modal-' + id;
|
config.name = '_dynamic-modal-' + id;
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ export default {
|
|||||||
id: id,
|
id: id,
|
||||||
component: modal,
|
component: modal,
|
||||||
params: params || {},
|
params: params || {},
|
||||||
config: config || {}
|
config: config
|
||||||
})
|
})
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$modal.show(config.name)
|
this.$modal.show(config.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user