基础数据类型转换处理

This commit is contained in:
714943302@qq.com
2018-12-10 14:06:01 +08:00
parent f5b69ae78f
commit 25c05b3de3
4 changed files with 15 additions and 5 deletions
@@ -72,7 +72,9 @@ export class CityComponent implements OnInit {
basicDataTransHandle() {
this.render_data.forEach(item => {
let countryLinkIndex = this.countrys.findIndex(val => val.countryId === item['countryId']);
item['countryNameChn'] = this.countrys[countryLinkIndex].countryNameChn;
if(this.countrys[countryLinkIndex]){
item['countryNameChn'] = this.countrys[countryLinkIndex].countryNameChn;
}
})
}
/**