I have a json object returned from the server that has a variable amount of date in roughly this format:
[{"data":{"level":1,"sub_level":1,"value": 10},
{"data":{"level":1,"sub_level":2,"value": 23},
{"data":{"level":1,"sub_level":3,"value": 3},
{"data":{"level":2,"sub_level":1,"value": 55},
{"data":{"level":2,"sub_level":2,"value": 52}]
I am trying to iterate through the data and get an output similar to the below HTML assuming there were nine elements in the data set to iterate through.
Basically, I want to ouput the dataset into groups of three objects, count the objects in each group and then repeat for the next three.
<div>
<span>1</span>
<ul>
<li>1 item.value</li>
<li>2 item.value</li>
<li>3 item.value</li>
</ul>
</div>
<div>
<span>2</span>
<ul>
<li>1 item.value</li>
<li>2 item.value</li>
<li>3 item.value</li>
</ul>
</div>
<div>
<span>3</span>
<ul>
<li>1 item.value</li>
<li>2 item.value</li>
<li>3 item.value</li>
</ul>
</div>
I'm not sure how the best way to do this in the Vue.js templates.