create app

This commit is contained in:
李志鹏
2026-02-02 13:32:33 +08:00
commit 721cf2066a
48 changed files with 16194 additions and 0 deletions

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

@@ -0,0 +1,32 @@
import { createRouter, createWebHistory } from 'vue-router'
/**
* 路由缓存机制:
* 1. 设置路由的meta属性为{ cache: true },表示需要缓存
* 2. App.vue中使用RouteCache组件通过路由的name来进行匹配
* 3. 路由的name默认是文件名,如果文件名与name不一致,通过defineOptions({ name: 'componentName' })来设置
*/
const router = createRouter({
history: createWebHistory('/'),
// history: createWebHistory(import.meta.env.VITE_APP_URL),
routes: [
// {
// path: '/',
// redirect: '/welcome'
// },
// {
// path: '/asistant',
// name: 'asistant',
// component: () => import('../views/asistant/index.vue'),
// meta: { cache: true, verify: () => VerifyIDs(2) }
// },
{
path: '/:pathMatch(.*)',
name: '404',
component: () => import('../views/404.vue'),
},
]
})
export default router