fix: reset page data on 404 (#497)

pull/552/head
Divyansh Singh 3 years ago committed by GitHub
parent 7cf70111a5
commit 28eaa3b04a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -123,6 +123,15 @@ export function createRouter(
latestPendingPath = null
route.path = pendingPath
route.component = fallbackComponent ? markRaw(fallbackComponent) : null
// reset page data
route.data = {
relativePath: '',
title: '404',
description: 'Not Found',
headers: [],
frontmatter: {},
lastUpdated: 0
}
}
}
}

@ -7,7 +7,7 @@ const { theme, page } = useData()
const hasLastUpdated = computed(() => {
const lu = theme.value.lastUpdated
return lu !== undefined && lu !== false
return lu !== undefined && lu !== false && page.value.lastUpdated !== 0
})
const prefix = computed(() => {

Loading…
Cancel
Save