张 元山 8 months ago
parent 4c8590a817
commit b858244008

@ -1,13 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>延庆博物馆</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

@ -3,7 +3,7 @@ import { createRouter, createWebHistory } from 'vue-router';
const routes = [
{
path: '/',
redirect: 'home'
redirect: 'home/navigation'
},
{
path: '/home',
@ -13,6 +13,7 @@ const routes = [
{
path: 'navigation',
name: 'navigation',
meta: { title: '首页' },
component: () => import('@/views/navigation/index.vue'),
},
]
@ -116,5 +117,9 @@ const router = createRouter({
history: createWebHistory(),
routes
});
router.beforeEach((to, from) => {
if (to.meta.title) {
document.title = to.meta.title
}
})
export default router;

Loading…
Cancel
Save