From 7f50b2b57779e8a00d2a9f48a627dc3a999597e0 Mon Sep 17 00:00:00 2001 From: PierreGAMEN Date: Fri, 6 Jun 2025 11:27:17 +0200 Subject: [PATCH] feat: add scroll handling and gradient effects to ATabs component --- components/ATabs.vue | 80 ++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 28 deletions(-) diff --git a/components/ATabs.vue b/components/ATabs.vue index 4ce9559..92db3ea 100644 --- a/components/ATabs.vue +++ b/components/ATabs.vue @@ -50,34 +50,34 @@ function toggle(value: string) { emit("tabSelected", value); activeValue.value = value; } + +import { ref, onMounted, onBeforeUnmount } from "vue"; + +const tabsContainer = ref(null); +const showLeftGradient = ref(false); + +function handleScroll() { + if (tabsContainer.value) { + showLeftGradient.value = tabsContainer.value.scrollLeft > 0; + } +} + +onMounted(() => { + handleScroll(); +}); +