File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,9 +7,11 @@ const excludedRoutes = new Set(['index', 'code'])
77const isActive = computed (() => ! excludedRoutes .has (route .name as string ))
88
99const isMounted = useMounted ()
10- const isVisible = ref (false )
10+ const isVisible = shallowRef (false )
1111const scrollThreshold = 300
12- const supportsScrollStateQueries = ref (false )
12+ const supportsScrollStateQueries = useSupported (() => {
13+ return isMounted .value && CSS .supports (' container-type' , ' scroll-state' )
14+ })
1315
1416function onScroll() {
1517 if (! supportsScrollStateQueries .value ) {
@@ -25,9 +27,6 @@ function scrollToTop() {
2527useEventListener (' scroll' , onScroll , { passive: true })
2628
2729onMounted (() => {
28- // Feature detect CSS scroll-state container queries (Chrome 133+)
29- supportsScrollStateQueries .value = CSS .supports (' container-type' , ' scroll-state' )
30-
3130 onScroll ()
3231})
3332 </script >
You can’t perform that action at this time.
0 commit comments