diff --git a/packages/dialog/index.js b/packages/dialog/index.js index 7f9991403..b6e7da4fc 100644 --- a/packages/dialog/index.js +++ b/packages/dialog/index.js @@ -27,11 +27,9 @@ const Dialog = options => { initInstance(); } - Object.assign(instance, { + Object.assign(instance, Dialog.currentOptions, options, { resolve, - reject, - ...Dialog.currentOptions, - ...options + reject }); }); }; @@ -57,10 +55,11 @@ Dialog.defaultOptions = { Dialog.alert = Dialog; -Dialog.confirm = options => Dialog({ - showCancelButton: true, - ...options -}); +Dialog.confirm = options => + Dialog({ + showCancelButton: true, + ...options + }); Dialog.close = () => { if (instance) { diff --git a/packages/image-preview/index.js b/packages/image-preview/index.js index f365600bd..242f54b7f 100644 --- a/packages/image-preview/index.js +++ b/packages/image-preview/index.js @@ -33,10 +33,7 @@ const ImagePreview = (images, startPosition = 0) => { const options = Array.isArray(images) ? { images, startPosition } : images; - Object.assign(instance, { - ...defaultConfig, - ...options - }); + Object.assign(instance, defaultConfig, options); instance.$once('input', show => { instance.value = show; diff --git a/packages/mixins/popup/manager.js b/packages/mixins/popup/manager.js index 6906d58b4..c35fb78c7 100644 --- a/packages/mixins/popup/manager.js +++ b/packages/mixins/popup/manager.js @@ -15,7 +15,7 @@ export default { const target = el && el.parentNode ? el.parentNode : document.body; context.stack.push({ vm, config, target }); this.update(); - }; + } }, close(vm) { @@ -51,9 +51,7 @@ export default { const { target, config } = context.top; target.appendChild(modal.$el); - Object.assign(modal, { - ...defaultConfig, - ...config, + Object.assign(modal, defaultConfig, config, { visible: true }); }