Answer the question
In order to leave comments, you need to log in
How to skip or start from another index in v-for?
<tr v-for="(value, index) in this.pedometer.gps.points"
:key="index"
>
<td v-text="`${value.latitude} ${value.longitude}`" />
<td v-text="`${pedometer.gps.points[index + 1].latitude} ${pedometer.gps.points[index + 1].longitude}`" />
<td v-text="distanceBetweenCoords(
value.latitude,
value.longitude,
pedometer.gps.points[index + 1].latitude,
pedometer.gps.points[index + 1].longitude)"
/>
</tr>
client.js?06a0:77 TypeError: Cannot read property 'latitude' of undefined
at eval (index.vue?9726:269)
Answer the question
In order to leave comments, you need to log in
v-if="(index === value)"
v-if="(index > value)"
v-if="(index < value)"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question