mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
fix(Area): When setting the attribute [columns-num=1 or columns-num=2] lower than the WeChat basic library version 2.7.7, the real machine environment reports an error (#3318)
This commit is contained in:
parent
3a60055f8e
commit
44194c711e
@ -201,14 +201,22 @@ VantComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const stack = [];
|
const stack = [];
|
||||||
|
const indexes = [];
|
||||||
|
|
||||||
|
if (this.data.columnsNum >= 1) {
|
||||||
stack.push(picker.setColumnValues(0, province, false));
|
stack.push(picker.setColumnValues(0, province, false));
|
||||||
stack.push(picker.setColumnValues(1, city, false));
|
indexes.push(this.getIndex('province', code));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.data.columnsNum >= 2) {
|
||||||
|
stack.push(picker.setColumnValues(1, city, false));
|
||||||
|
indexes.push(this.getIndex('province', code));
|
||||||
if (city.length && code.slice(2, 4) === '00') {
|
if (city.length && code.slice(2, 4) === '00') {
|
||||||
[{ code }] = city;
|
[{ code }] = city;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.data.columnsNum === 3) {
|
||||||
stack.push(
|
stack.push(
|
||||||
picker.setColumnValues(
|
picker.setColumnValues(
|
||||||
2,
|
2,
|
||||||
@ -216,16 +224,11 @@ VantComponent({
|
|||||||
false
|
false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return Promise.all(stack)
|
return Promise.all(stack)
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
.then(() =>
|
.then(() => picker.setIndexes(indexes))
|
||||||
picker.setIndexes([
|
|
||||||
this.getIndex('province', code),
|
|
||||||
this.getIndex('city', code),
|
|
||||||
this.getIndex('county', code),
|
|
||||||
])
|
|
||||||
)
|
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user