Commit 799391ce by qinjianhui

fix: 地址设置默认状态

parent d744442e
...@@ -98,12 +98,18 @@ export default { ...@@ -98,12 +98,18 @@ export default {
return this.locations[this.locationIndex] return this.locations[this.locationIndex]
}, },
}, },
created() {
this.setLocation(0)
},
methods: { methods: {
onLocationClicked(e) { onLocationClicked(e) {
const locationIndex = this.locations.findIndex( const locationIndex = this.locations.findIndex(
(ee) => ee.city === e.target.getLabel().content (ee) => ee.city === e.target.getLabel().content
) )
this.locationIndex = locationIndex this.setLocation(locationIndex)
},
setLocation(index) {
this.locationIndex = index
this.center = [this.location.longitude, this.location.latitude] this.center = [this.location.longitude, this.location.latitude]
this.zoom = 15 this.zoom = 15
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment