D
D
Denis Bukreev2018-09-10 07:23:11
Vue.js
Denis Bukreev, 2018-09-10 07:23:11

How to output a for loop in Vue?

We need not the cycle described in the docks v-for="item in items", but an iterative (?) cycle:

for (let i = 0; i < count; i++) {
  //
}

Unfortunately, this is not visible in the documentation.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2018-09-10
@denisbookreev

v-forknows how to do everything, incl. in the range :

<div>
  <span v-for="n in 10">{{ n }} </span>
</div>
<!-- получится 1 2 3 4 5 6 7 8 9 10 -->

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question