mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
fixed Cannot read property county_list of null (#684)
This commit is contained in:
parent
c1be15ecb6
commit
8e003a0ee7
@ -89,7 +89,7 @@ VantComponent({
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const list = this.data.areaList[`${type}_list`] || {};
|
const list = this.data.areaList && this.data.areaList[`${type}_list`] || {};
|
||||||
result = Object.keys(list).map(code => ({
|
result = Object.keys(list).map(code => ({
|
||||||
code,
|
code,
|
||||||
name: list[code]
|
name: list[code]
|
||||||
@ -117,7 +117,7 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
setValues() {
|
setValues() {
|
||||||
let code = this.code || Object.keys(this.data.areaList.county_list || {})[0] || '';
|
let code = this.code || this.data.areaList && Object.keys(this.data.areaList.county_list || {})[0] || '';
|
||||||
const province = this.getList('province');
|
const province = this.getList('province');
|
||||||
const city = this.getList('city', code.slice(0, 2));
|
const city = this.getList('city', code.slice(0, 2));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user