[Vuejs]-Vue array and loop issues

0👍

figured it out ages ago now playerData[‘hole_scores_R’ + i]

as requested more info in the answer:-

<td v-for="(i, roundIt) in range(1, roundsPlayed)" :key="roundIt">. 
  <span v-if="roundsPlayed === 1 && tabledata.vspar < 0" class="up"> 
     {{ tabledata.score }}
  </span>
  <span v-else-if="roundsPlayed === 1 && tabledata.vspar > 0" 
   class="down">{{ tabledata.score }}
  </span>
  <span v-else-if="roundsPlayed === 1">
   {{ tabledata.score }}
  </span>
  <span v-else-if="tabledata['vspar_R' + i] < 0" :class="up">
   {{ tabledata["score_R" + i] }}
  </span> 
  <span v-else-if="tabledata['vspar_R' + i] > 0" :class="down">
   {{ tabledata["score_R" + i] }}</span> 
  <span v-else>
   {{ tabledata["score_R" + i] }}
  </span> 
</td>

Leave a comment