'Showing multiple images in Vue3-carousel

I've searched the web far and wide for answers, but to no avail.

Could a kind soul please explain to me, a novice, how I get three separate images shown using Vue3-carousel?

I've had a look at the Vue3-carousel docs, but if the solution is there, I'm not seeing it.

<template>
  <section class="productOverview">
    <Carousel :itemsToShow="3" :wrapAround="true">
      <Slide v-for="slide in 3" :key="slide">
        <div class="carousel__item">{{ slide }}</div>
      </Slide>
    </Carousel>
  </section>
</template>

I assume the magic happens somewhere in the script area...

<script>
 import { defineComponent } from "vue";
 import { Carousel, Slide } from "vue3-carousel";
 import "vue3-carousel/dist/carousel.css";
    
 export default defineComponent({
  name: "Autoplay",
  components: {
    Carousel,
    Slide,
  },
});
</script>

Thanks in advance.



Solution 1:[1]

Actually, this error is in Arr::flatten(Cookie::get('wishlist') helper not in your blade's @foreach loop. Because Arr::flatten is accept multi-dimension array to convert into a single array. But you are trying to pass a wishlist cookie value that is actually an integer or string.

So, you need to store wishlist book ids with user_id into the database as a wishlist table instead of saving in cookies.

And make this query to get the wishlist books:

$wishlist = Wishlist::where('user_id', Auth::id())->pluck('id');

$books = Book::query()->whereHas('bookCopies', function ($q) {
                $q->whereIn('id', $wishlist);
            })->get();

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 PULL STACK DEV