How does v-for traverse an array in an object in vue?

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

Mar.28,2021

[{x: '', y: ''},{x: '', y: ''}]

data in this format

let lat = [] //
let we = [] //  latwe
let newArr = []
for(var i;i<lat.length;iPP){
    let item = {}
    item.x = lat[i];
    item.y = we[i];
    newArr.push(item)
}
console.log(newArr)

that would be better

  <gmap-marker v-for="(item,index) in positions.lat" :key='index' 

  </gmap-marker>

Thank you. I think it's more complicated. Post the code:
< gmap-marker Vmurf = "(item,index) in positions": key='index'
: position= "{lat:Number (item.lat), lng:Number (item.lon)}" >
< / gmap-marker >
positions: [],
this.position.forEach (ele = > {
this.positions.push ({lat: ele.lat,lon: ele.lon})
})

)

Menu