Loop within <script> tags?
-
I know that the standard way to loop with quasar is v-for. But is there a way to loop within a function in the <script> section?
-
Anything within the
<script>
tags of a Vue single file component is normal JavaScript, albeit needing Vue’s Options API to make things work in Vue (or Quasar).Scott
-
So how would I do something like:
var i;
for (i = 0; i < cars.length; i++) {
text += cars[i] + “<br>”;
} -
@omgwalt same as you would in normal js.
-
Hmm … well, now I’m not getting errors when I try it. Weird. I must have typed something wrong the first time. Thanks.