File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
2+ import type { PerfectScrollbarExpose } from ' vue3-perfect-scrollbar'
23import { i18n } from ' @/electron'
34import { router , RouterName } from ' @/router'
45import { useRoute } from ' vue-router'
56
67const route = useRoute ()
8+ const scrollRef = useTemplateRef <PerfectScrollbarExpose >(' scrollRef' )
79
810const isActiveRoute = computed (() => {
911 return (name : string ) => route .name === name
@@ -88,6 +90,15 @@ const generatorsNav = [
8890 name: RouterName .devtoolsLoremIpsumGenerator ,
8991 },
9092]
93+
94+ watch (
95+ () => route .name ,
96+ () => {
97+ nextTick (() => {
98+ scrollRef .value ?.ps ?.update ()
99+ })
100+ },
101+ )
91102 </script >
92103
93104<template >
@@ -160,6 +171,7 @@ const generatorsNav = [
160171 </template >
161172 <template #right >
162173 <PerfectScrollbar
174+ ref =" scrollRef"
163175 class =" h-full px-5 pb-5"
164176 :options =" { minScrollbarLength: 20 }"
165177 >
You can’t perform that action at this time.
0 commit comments