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

    QCarousel using v-for

    Help
    2
    6
    2614
    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.
    • Q
      QuaSam last edited by QuaSam

      (Revised Post with Answer): Using QCarousel with the v-for iteration was giving me problems - which were solved thanks to Scott Molineri with following link:
      https://codepen.io/smolinari/pen/VwZOBYx?editors=1010 << Thank you, Scott - worth a cup of coffee!
      A look at this simple fix, no need to read the whole thread (I had thought v-model was not needed):

      <!–
      Forked from:
      https://quasar.dev/vue-components/carousel#Example--Image-slides
      –>
      <div id=“q-app”>
      <div class=“q-pa-md”>
      <q-carousel
      animated
      v-model=“slide”
      arrows
      navigation
      infinite
      >
      <q-carousel-slide v-for=“slide in slides”:key=“slide.id”:name=“slide.id” :img-src=“slide.url” ></q-carousel-slide>
      </q-carousel>
      </div>
      </div>
      Script:
      const slides = [
      {
      id: 1,
      url: ‘https://cdn.quasar.dev/img/mountains.jpg’
      },
      {
      id: 2,
      url: ‘https://cdn.quasar.dev/img/parallax1.jpg’
      }
      ]
      And add to data:
      data () {
      return {
      slide: 1,
      slides
      }
      }

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

        You don’t need “this” in the template. This is basic Vue knowledge.

        Sorry for the mix in version content, but it’s too late to “purge” now.

        Scott

        1 Reply Last reply Reply Quote 0
        • Q
          QuaSam last edited by

          Thanks for your prompt response, Scott. I added the this. parameter among the many things tried to resolve the problem; sorry not to remove it prior to the post.
          However, removing the “this.” does not clear the “missing value” problem. How should the name parameter be set - is it required for the carousel? What I am thinking is take the Autoplay example [or one with captions] in QCarousel doco and implement it with the v-for construct; alternatively, could this thread be removed and replaced with the code that would apply to that demo? I think something needs to be done in the forum to get rid of old material and net-out the answers. Thanks for any assistance.

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

            Works like a charm! 😁

            https://codepen.io/smolinari/pen/VwZOBYx?editors=1010

            Scott

            1 Reply Last reply Reply Quote 0
            • Q
              QuaSam last edited by QuaSam

              Thanx again - see revised post, hope ok. You should be seeing a cup of coffee.

              (Pls check: Link on Patreon "go back to Scott Molinari’s Page is broken, gets 404)

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

                Thanks for the coffee!

                Is your issue resolved now?

                Scott

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