Skip to content

Commit c607489

Browse files
committed
fix: Correct enhanceApp parameter destructuring and router event name
1 parent 5ad6c70 commit c607489

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/.vitepress/theme/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ function attachHeroCtaTracking() {
5757

5858
const theme: Theme = {
5959
...DefaultTheme,
60-
enhanceApp({ app, router }) {
61-
DefaultTheme.enhanceApp?.({ app, router })
60+
enhanceApp(ctx) {
61+
DefaultTheme.enhanceApp?.(ctx)
62+
const { app, router } = ctx
6263
app.component('VideoPlayer', VideoPlayer)
6364
if (typeof window !== 'undefined') {
6465
// Attach initial listeners after hydration
@@ -67,7 +68,7 @@ const theme: Theme = {
6768
attachHeroCtaTracking()
6869
}, 0)
6970
// Track SPA navigations and re-bind outbound tracking
70-
router.onAfterRouteChanged = () => {
71+
router.onAfterRouteChange = () => {
7172
const w = window as any
7273
const url = window.location.pathname + window.location.search + window.location.hash
7374
if (w.umami?.trackView) {

0 commit comments

Comments
 (0)