problem description
there is a problem in map development: everything has coordinate points composed of X and Y, and the background data is finally parsed into two arrays. If you want to generate dynamically, but the coordinate system has two values, a label can only have one v-for
.the environmental background of the problems and what methods you have tried
I"ve tried to nest a div in the outer layer, first iterate through a div, and then cycle through a single, which seems to have doubled
.related codes
/ / Please paste the code text below (do not replace the code with pictures)
<gmap-marker v-for="(item,index) in positions" :key="index"
:position="{lat:Number(item.lat),lng:Number(item.lon)}">
</gmap-marker>
data () {
return {
position: [],
positions: {
lat: [],
lon: []
},
}
},
this.position = reponse.data.data;
this.position.forEach(ele => {
this.positions.lat.push(ele.lat);
this.positions.lon.push(ele.lon);
})
what result do you expect? What is the error message actually seen?
I hope to loop out two arrays, one v-for, please