[improvement] AddressEdit: optimize area label (#1785)

This commit is contained in:
neverland
2018-09-12 11:58:12 +08:00
committed by GitHub
parent 374858af19
commit d69f77200e
2 changed files with 9 additions and 4 deletions

View File

@@ -166,9 +166,14 @@ export default create({
areaText() {
const { province, city, county, areaCode } = this.data;
return province && city && county && areaCode
? `${province} ${city} ${county}`
: '';
if (province && city && county && areaCode) {
const arr = [province, city, county];
if (province === city) {
arr.shift();
}
return arr.join('/');
}
return '';
}
},