diff --git a/src/address-edit/index.js b/src/address-edit/index.js index f26643071..852b4460b 100644 --- a/src/address-edit/index.js +++ b/src/address-edit/index.js @@ -140,10 +140,12 @@ export default createComponent({ onAreaConfirm(values) { values = values.filter(value => !!value); + if (values.some(value => !value.code)) { Toast(t('areaEmpty')); return; } + this.showAreaPopup = false; this.assignAreaValues(); this.$emit('change-area', values); @@ -151,6 +153,7 @@ export default createComponent({ assignAreaValues() { const { area } = this.$refs; + if (area) { const detail = area.getArea(); detail.areaCode = detail.code; @@ -247,7 +250,8 @@ export default createComponent({ const onFocus = name => () => this.onFocus(name); // hide bottom field when use search && detail get focused - const hideBottomFields = searchResult && searchResult.length && this.detailFocused; + const hideBottomFields = + searchResult && searchResult.length && this.detailFocused; return (
diff --git a/src/address-list/Item.tsx b/src/address-list/Item.tsx index 018fe455c..aa7b3b0b7 100644 --- a/src/address-list/Item.tsx +++ b/src/address-list/Item.tsx @@ -94,8 +94,8 @@ function AddressItem( return ( - {slots.top && slots.top()} + {slots.top?.()} {List} {props.disabledText &&
{props.disabledText}
} {DisabledList} - {slots.default && slots.default()} + {slots.default?.()}