Przeglądaj źródła

correction carousel review

Maha Bouchiba 2 lat temu
rodzic
commit
a1a706f1b3
1 zmienionych plików z 10 dodań i 3 usunięć
  1. 10 3
      components/Home/Reviews.vue

+ 10 - 3
components/Home/Reviews.vue

@@ -161,6 +161,16 @@
 
 <script setup>
 import { Carousel, Slide } from "vue3-carousel";
+import "vue3-carousel/dist/carousel.css";
+const carousel = ref(null);
+
+const goPrevious = () => {
+  carousel.value.prev();
+};
+
+const goNext = () => {
+  carousel.value.next();
+};
 const items = ref([
   { src: "/images/reviews/review1.png" },
   { src: "/images/reviews/review2.png" },
@@ -168,10 +178,7 @@ const items = ref([
   { src: "/images/reviews/review4.png" },
   { src: "/images/reviews/review5.png" },
 ]);
-let carousel;
 
-const goPrevious = () => carousel.prev();
-const goNext = () => carousel.next();
 </script>
 
 <style scoped>