mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 07:57:21 +08:00
fix: 404时标题为undefined
This commit is contained in:
@@ -6,7 +6,7 @@ import { useThemeStore } from '@/store'
|
||||
export function createPageTitleGuard(router: Router) {
|
||||
const themeStore = useThemeStore()
|
||||
router.afterEach((to) => {
|
||||
const pageTitle = translateTitle(String(to.meta.title))
|
||||
const pageTitle = typeof to.meta.title === 'string' ? translateTitle(to.meta.title) : '404'
|
||||
if (pageTitle) document.title = `${pageTitle} | ${themeStore.name}`
|
||||
else document.title = themeStore.name
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user