Kaynağa Gözat

correction news.vue

Maha Bouchiba 2 yıl önce
ebeveyn
işleme
3cc9d8c9db
1 değiştirilmiş dosya ile 12 ekleme ve 6 silme
  1. 12 6
      components/Home/News.vue

+ 12 - 6
components/Home/News.vue

@@ -55,10 +55,21 @@
 </template>
 
 <script setup>
-import { ref } from "vue";
 import { Carousel, Slide } from "vue3-carousel";
 import "vue3-carousel/dist/carousel.css";
 
+const carousel = ref(null);
+
+const goPrevious = () => {
+  console.log("goPrevious a été appelé");
+  carousel.value.prev();
+};
+
+const goNext = () => {
+  console.log("goNext a été appelé");
+  carousel.value.next();
+};
+
 const actus = ref([
   {
     title: "Suivi Pédagogique",
@@ -109,11 +120,6 @@ const actus = ref([
     img: "/images/actu/actu2.jpg",
   },
 ]);
-
-let carousel;
-
-const goPrevious = () => carousel.prev();
-const goNext = () => carousel.next();
 </script>
 
 <style scoped>