Answer the question
In order to leave comments, you need to log in
How to do a simple iteration of values from 30 to 40 in a vue.js loop?
How to do a simple iteration of values from 30 to 40 in a vue.js loop?
something like:
for(var i = 30; i < 41; i++)
{
}
Answer the question
In order to leave comments, you need to log in
If you're referring to the v-for directive, iterating over values is easy:
It's not possible to set the start value of the loop in this case, here Evan Yu explains why he decided not to add this capability to this directive.
If you still need to iterate numbers not from zero, but from 30, you can use this solution (taken from the same link):
Note that the starting index value in v-for is not 0 , as we are used to in regular JS loops , and unit.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question