Skip to content

Commit

Permalink
docs: fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
victorgarciaesgi committed Dec 14, 2024
1 parent 06310b3 commit 9afefdc
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,18 @@ export default {
() =>
nextTick(() => {
scrollToActiveSidebarItem();
}),
{
immediate: true,
}
})
);
},
} satisfies Theme;

function scrollToActiveSidebarItem() {
setTimeout(() => {
const activeLink = document.querySelector('#VPSidebarNav div.is-link.is-active.has-active');
if (activeLink) {
activeLink.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
}, 1000);
if (typeof window !== 'undefined') {
setTimeout(() => {
const activeLink = document.querySelector('#VPSidebarNav div.is-link.is-active.has-active');
if (activeLink) {
activeLink.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
}, 1000);
}
}

0 comments on commit 9afefdc

Please sign in to comment.