From c35f0cfdb415b1783c2b4fd44e8bc90c6d4a010e Mon Sep 17 00:00:00 2001 From: riverflow <3011499946@qq.com> Date: Sun, 10 Aug 2025 17:27:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8index.html=E6=96=87=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E4=BF=AE=E6=94=B9title=E4=B8=BA=E6=A0=A1=E5=9B=AD=E7=82=B9?= =?UTF-8?q?=E9=A4=90=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在路由router.index.ts中配置自动跳转到首页 通过redirect: '/dashboard'实现首页自动跳转 在views文件夹中创建首页文件夹dashboard以及Index.vue 修改菜单layout.Menu.vue,增加首页选项 --- order-system/index.html | 3 ++- order-system/src/layout/Menu.vue | 6 ++++++ order-system/src/router/index.ts | 14 ++++++++++++-- order-system/src/views/dashboard/Index.vue | 13 +++++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 order-system/src/views/dashboard/Index.vue diff --git a/order-system/index.html b/order-system/index.html index 8888766..ef9d679 100644 --- a/order-system/index.html +++ b/order-system/index.html @@ -4,7 +4,8 @@ - Vite + Vue + TS + + 校园点餐系统
diff --git a/order-system/src/layout/Menu.vue b/order-system/src/layout/Menu.vue index 3a527fc..a58132f 100644 --- a/order-system/src/layout/Menu.vue +++ b/order-system/src/layout/Menu.vue @@ -39,6 +39,12 @@ --> + + + + + + diff --git a/order-system/src/router/index.ts b/order-system/src/router/index.ts index 85712a3..6804634 100644 --- a/order-system/src/router/index.ts +++ b/order-system/src/router/index.ts @@ -10,12 +10,22 @@ import Layout from '@/layout/Index.vue' const routes: Array = [ { - path: '/home', - name: 'home', //name中home大小写错误,第32次提交之前为大写 + // 通过redirect: '/dashboard'实现首页自动跳转 + path: '/', + // name: 'home', //name中home大小写错误,第32次提交之前为大写 component: Layout, + // 实现打开浏览器后自动跳转首页 + redirect: '/dashboard', + // 添加子页面路由 children: [ + // 添加首页面路由 + { + path: '/dashboard', + name: 'dashboard', + component: () => import('@/views/dashboard/Index.vue') + }, { path: '/banner', name: 'banner', diff --git a/order-system/src/views/dashboard/Index.vue b/order-system/src/views/dashboard/Index.vue new file mode 100644 index 0000000..8bf3445 --- /dev/null +++ b/order-system/src/views/dashboard/Index.vue @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file