mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] AddressEdit: setAreaCode now work (#524)
This commit is contained in:
parent
7278d90c12
commit
0bb1fe69a3
@ -263,10 +263,12 @@ export default create({
|
||||
setAreaCode(code) {
|
||||
this.currentInfo.area_code = code;
|
||||
this.$nextTick(() => {
|
||||
const { area } = this.$refs;
|
||||
if (area) {
|
||||
this.assignAreaValues(area.getValues());
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
const { area } = this.$refs;
|
||||
if (area) {
|
||||
this.assignAreaValues(area.getValues());
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -86,9 +86,9 @@ export default {
|
||||
name: '名字',
|
||||
tel: '手机或固定电话',
|
||||
postal: '邮政编码(选填)',
|
||||
province: '选择省',
|
||||
city: '选择市',
|
||||
county: '选择区'
|
||||
province: '选择省份',
|
||||
city: '选择城市',
|
||||
county: '选择地区'
|
||||
}
|
||||
},
|
||||
vanAddressEditDetail: {
|
||||
|
@ -17,13 +17,13 @@ describe('AddressEdit', () => {
|
||||
expect(wrapper.find('.van-field__control')[2].element.value).to.equal('');
|
||||
expect(
|
||||
wrapper.find('.van-address-edit__area .van-cell__value span')[0].text()
|
||||
).to.equal('选择省');
|
||||
).to.equal('选择省份');
|
||||
expect(
|
||||
wrapper.find('.van-address-edit__area .van-cell__value span')[1].text()
|
||||
).to.equal('选择市');
|
||||
).to.equal('选择城市');
|
||||
expect(
|
||||
wrapper.find('.van-address-edit__area .van-cell__value span')[2].text()
|
||||
).to.equal('选择区');
|
||||
).to.equal('选择地区');
|
||||
});
|
||||
|
||||
it('create a AddressEdit with props', () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user