Skip to content

Commit 28eaa3b

Browse files
authored
fix: reset page data on 404 (#497)
1 parent 7cf7011 commit 28eaa3b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/client/app/router.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ export function createRouter(
123123
latestPendingPath = null
124124
route.path = pendingPath
125125
route.component = fallbackComponent ? markRaw(fallbackComponent) : null
126+
// reset page data
127+
route.data = {
128+
relativePath: '',
129+
title: '404',
130+
description: 'Not Found',
131+
headers: [],
132+
frontmatter: {},
133+
lastUpdated: 0
134+
}
126135
}
127136
}
128137
}

src/client/theme-default/components/LastUpdated.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { theme, page } = useData()
77
const hasLastUpdated = computed(() => {
88
const lu = theme.value.lastUpdated
99
10-
return lu !== undefined && lu !== false
10+
return lu !== undefined && lu !== false && page.value.lastUpdated !== 0
1111
})
1212
1313
const prefix = computed(() => {

0 commit comments

Comments
 (0)