前端公共部分开发完成,支持图片展示功能

This commit is contained in:
2026-01-27 12:56:17 +08:00
parent 911e58c29b
commit be0bcb4d51
25 changed files with 3252 additions and 19 deletions

View File

@@ -0,0 +1,33 @@
import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import ImageView from '@/views/ImageView.vue'
const router = createRouter({
history: createWebHistory(),
routes: [
{
path: '/',
name: 'Home',
component: Home,
meta: {
title: '必应每日一图'
}
},
{
path: '/image/:date',
name: 'ImageView',
component: ImageView,
meta: {
title: '图片详情'
}
}
]
})
// 路由守卫 - 更新页面标题
router.beforeEach((to, _from, next) => {
document.title = (to.meta.title as string) || '必应每日一图'
next()
})
export default router