No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Loop within <script> tags?

    Framework
    3
    5
    196
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      omgwalt last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        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

        1 Reply Last reply Reply Quote 0
        • O
          omgwalt last edited by

          So how would I do something like:

          var i;
          for (i = 0; i < cars.length; i++) {
          text += cars[i] + “<br>”;
          }

          metalsadman 1 Reply Last reply Reply Quote 0
          • metalsadman
            metalsadman @omgwalt last edited by metalsadman

            @omgwalt same as you would in normal js.

            1 Reply Last reply Reply Quote 0
            • O
              omgwalt last edited by

              Hmm … well, now I’m not getting errors when I try it. Weird. I must have typed something wrong the first time. Thanks.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post