From 190cd7eba4bce0b28bb4f020249e0a9af25a9a5f Mon Sep 17 00:00:00 2001 From: Jake Date: Fri, 18 Oct 2019 11:51:16 +0800 Subject: [PATCH] fix(AddressEdit): choose overseas failure when configuring placeholer (#4769) --- docs/src/docs-entry.js | 1 - packages/address-edit/index.js | 2 ++ packages/area/index.js | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/src/docs-entry.js b/docs/src/docs-entry.js index 18901821b..80bb7857a 100644 --- a/docs/src/docs-entry.js +++ b/docs/src/docs-entry.js @@ -2,7 +2,6 @@ // This file is auto gererated by build/build-entry.js export default { 'changelog.en-US': () => import('../markdown/changelog.en-US.md'), - 'changelog.generated': () => import('../markdown/changelog.generated.md'), 'changelog.zh-CN': () => import('../markdown/changelog.zh-CN.md'), 'contribution.zh-CN': () => import('../markdown/contribution.zh-CN.md'), 'design.zh-CN': () => import('../markdown/design.zh-CN.md'), diff --git a/packages/address-edit/index.js b/packages/address-edit/index.js index 863d6bcfd..02179c2f7 100644 --- a/packages/address-edit/index.js +++ b/packages/address-edit/index.js @@ -127,6 +127,8 @@ export default sfc({ }, onAreaConfirm(values) { + values = values.filter(value => !!value); + if (values.some(value => !value.code)) { Toast(t('areaEmpty')); return; diff --git a/packages/area/index.js b/packages/area/index.js index f7c3a2dac..630dc0dd6 100644 --- a/packages/area/index.js +++ b/packages/area/index.js @@ -137,7 +137,10 @@ export default sfc({ // parse output columns data parseOutputValues(values) { - return values.map((value = {}, index) => { + return values.map((value, index) => { + // save undefined value + if (!value) return value; + value = JSON.parse(JSON.stringify(value)); if (!value.code || value.name === this.columnsPlaceholder[index]) { value.code = '';