mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 10:59:42 +08:00
判断优化,以防万一
This commit is contained in:
parent
59312d192e
commit
d2422a4199
@ -250,7 +250,7 @@ export class CityPicker extends React.Component<
|
|||||||
if (db[cityCode]) {
|
if (db[cityCode]) {
|
||||||
state.cityCode = cityCode;
|
state.cityCode = cityCode;
|
||||||
state.city = db[cityCode];
|
state.city = db[cityCode];
|
||||||
} else if (~db.city[provinceCode].indexOf(code)) {
|
} else if (~db.city[provinceCode]?.indexOf(code)) {
|
||||||
state.cityCode = code;
|
state.cityCode = code;
|
||||||
state.city = db[code];
|
state.city = db[code];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user