From 47da340996b9db79877b3fe55af9506fa1f0094a Mon Sep 17 00:00:00 2001 From: talktao Date: Fri, 18 Mar 2022 22:27:51 +0800 Subject: [PATCH] =?UTF-8?q?init=EF=BC=9A=E8=B7=AF=E7=94=B1=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 53 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/router/index.ts diff --git a/src/router/index.ts b/src/router/index.ts new file mode 100644 index 0000000..fe096f8 --- /dev/null +++ b/src/router/index.ts @@ -0,0 +1,53 @@ +import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"; + +const routes: Array = [ + { + path: '/', + name: 'Index', + component: () => import ('@/layout/index.vue'), + redirect: '/home', + meta: { + title: '首页', + keepAlive:false + }, + children: [ + { + path: '/home', + name: 'Home', + component: () => import('@/views/home/Home.vue') + }, + { + path: '/category', + name: 'Category', + component: () => import('@/views/category/Category.vue') + }, + { + path: '/welfare', + name: 'Welfare', + component: () => import('@/views/welfare/Welfare.vue') + }, + { + path: '/orders', + name: 'Orders', + component: () => import('@/views/orders/Orders.vue') + }, + { + path: '/about', + name: 'About', + component: () => import('@/views/about/About.vue') + }, + { + path: '/detail/:id', + name: 'Detail', + component: () => import('@/views/Detail.vue') + } + ] + }, +] + +const router = createRouter({ + history: createWebHashHistory(), + routes, +}); + +export default router