首页+登录页

This commit is contained in:
2025-08-07 16:39:37 +08:00
commit a161520e7b
60 changed files with 5456 additions and 0 deletions

100
src/router/index.ts Normal file
View File

@ -0,0 +1,100 @@
import { createRouter, createWebHistory } from "vue-router";
import layout from "@/Layout.vue";
import Home from '@/views/Home.vue';
// 导入视图组件 - 修改为@开头的懒加载路径
const Gallery = () => import("@/views/Gallery.vue");
const Article = () => import("@/views/Article.vue");
const Widget = () => import("@/views/Widget.vue");
const AppShare = () => import("@/views/AppShare.vue");
const Plink = () => import("@/views/Plink.vue");
const Login = () => import("@/views/login/Login.vue");
const NotFound = () => import("@/views/NotFound.vue");
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: "/",
meta: {},
children: [
{
path: "/",
component: layout,
redirect: {name:'home'},
children: [
{
path: "/home",
name: "home",
component: Home,
meta: {
title:'首页'
},
},
{
path: "/gallery",
name: "gallery",
component: Gallery,
meta: {
title:'画廊'
},
},
{
path: "/article",
name: "article",
component: Article,
meta: {
title:'文章'
},
},
{
path: "/widget",
name: "widget",
component: Widget,
meta: {
title:'工具'
},
},
{
path: "/appshare",
name: "appShare",
component: AppShare,
meta: {
title:'软件分享'
},
},
{
path: "/plink",
name: "plink",
component: Plink,
meta: {
title:'友链'
},
},
],
},
{
path: "/login",
name: "login",
component: Login,
meta: {
title:'登录'
},
},
{
path: "/404",
name: "404",
component: NotFound,
meta: {
title:'错误页'
},
},
],
},
],
});
export default router;