mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-04 18:10:10 +08:00
更改查找不显示问题
This commit is contained in:
@@ -485,7 +485,7 @@ export default {
|
||||
// console.log("data", data); // data就是它传过来的值
|
||||
// console.log("原始this.station", this.station);
|
||||
// 地址
|
||||
this.detailedAddress = data.address;
|
||||
// this.detailedAddress = data.address;
|
||||
// console.log("详细地址", data.address);
|
||||
var adcode = data.adcode;
|
||||
var areaCode = [];
|
||||
@@ -498,14 +498,15 @@ export default {
|
||||
this.station.stationLng = String(data.pos[0]);
|
||||
this.station.stationLat = String(data.pos[1]);
|
||||
// console.log("修改后this.station", this.station);
|
||||
|
||||
console.log(data.address,'data.address')
|
||||
this.station.address = data.address.includes('区') ? data.address.replace(/区/, ' ').split(' ')[1] : data.address
|
||||
// 优化之后
|
||||
let newAddress2 = this.detailedAddress
|
||||
.replace(/(?<=[省市区])/g, "$&,")
|
||||
.split(",");
|
||||
let end = newAddress2.pop();
|
||||
console.log("详细地址", end);
|
||||
this.station.address = end;
|
||||
// let newAddress2 = this.detailedAddress
|
||||
// .replace(/(?<=[省市区])/g, "$&,")
|
||||
// .split(",");
|
||||
// let end = newAddress2.pop();
|
||||
// console.log("详细地址",this.station.areaCode,newAddress2);
|
||||
// this.station.address = newAddress2;
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
|
||||
Reference in New Issue
Block a user