feat(AddressEdit): add new prop disable-area (#5630)

This commit is contained in:
rex
2020-02-07 10:57:36 +08:00
committed by GitHub
parent d97e679e68
commit fd9cd12fe5
3 changed files with 11 additions and 4 deletions

View File

@@ -52,6 +52,7 @@ export default createComponent({
type: Boolean,
default: true,
},
disableArea: Boolean,
detailRows: {
type: [Number, String],
default: 1,
@@ -250,7 +251,7 @@ export default createComponent({
},
render() {
const { data, errorInfo, searchResult } = this;
const { data, errorInfo, searchResult, disableArea } = this;
const onFocus = name => () => this.onFocus(name);
// hide bottom field when use search && detail get focused
@@ -280,15 +281,15 @@ export default createComponent({
<Field
vShow={this.showArea}
readonly
clickable
clickable={!disableArea}
label={t('area')}
placeholder={t('areaPlaceholder')}
errorMessage={errorInfo.areaCode}
rightIcon="arrow"
rightIcon={!disableArea ? 'arrow' : null}
value={this.areaText}
onFocus={onFocus('areaCode')}
onClick={() => {
this.showAreaPopup = true;
this.showAreaPopup = !disableArea;
}}
/>
<Detail