mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-23 15:09:16 +08:00
[improvement] AddressEdit: optimize area label (#1785)
This commit is contained in:
parent
374858af19
commit
d69f77200e
@ -166,9 +166,14 @@ export default create({
|
|||||||
|
|
||||||
areaText() {
|
areaText() {
|
||||||
const { province, city, county, areaCode } = this.data;
|
const { province, city, county, areaCode } = this.data;
|
||||||
return province && city && county && areaCode
|
if (province && city && county && areaCode) {
|
||||||
? `${province} ${city} ${county}`
|
const arr = [province, city, county];
|
||||||
: '';
|
if (province === city) {
|
||||||
|
arr.shift();
|
||||||
|
}
|
||||||
|
return arr.join('/');
|
||||||
|
}
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ exports[`create a AddressEdit with props 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
<div class="van-cell__value">
|
<div class="van-cell__value">
|
||||||
<div class="van-field__body">
|
<div class="van-field__body">
|
||||||
<input type="text" readonly="readonly" placeholder="选择省 / 市 / 区" value="北京市 北京市 朝阳区" class="van-field__control">
|
<input type="text" readonly="readonly" placeholder="选择省 / 市 / 区" value="北京市/朝阳区" class="van-field__control">
|
||||||
<!---->
|
<!---->
|
||||||
<!---->
|
<!---->
|
||||||
<!---->
|
<!---->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user