diff --git a/frontend/components/profile/ProfileSidebar.vue b/frontend/components/profile/ProfileSidebar.vue index 8985059..cd533a3 100644 --- a/frontend/components/profile/ProfileSidebar.vue +++ b/frontend/components/profile/ProfileSidebar.vue @@ -27,9 +27,18 @@ const profileLinks = ref([ icon: "bi:ticket", title: "تیکت ها", path: { name: "profile-tickets" }, + matchPattern: /^profile-ticket/, }, ]); +const isLinkActive = (link: any) => { + if (link.matchPattern) { + return link.matchPattern.test(route.name); + } else { + return route.name === link.path.name; + } +}; + // queries const { data: account, suspense } = useGetAccount(); @@ -66,9 +75,9 @@ await suspense(); :key="index" :to="{ ...link.path }" :class=" - route.name == link.path.name - ? 'bg-black text-slate-100 **:fill-slate-100 ' - : '**:fill-black ' + isLinkActive(link) + ? 'bg-black text-slate-100 **:fill-slate-100' + : '**:fill-black' " class="flex items-center justify-between transition-all rounded-lg py-4 px-3" >