This commit is contained in:
wtq
2025-11-28 10:51:05 +08:00
commit 8b7a4c9556
17 changed files with 14211 additions and 0 deletions

53
src/router/index.js Normal file
View File

@@ -0,0 +1,53 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
// 路由懒加载
const Home = () => import('@/views/home/Home')
const DownLoad = () => import('@/views/download/downLoad')
const routes = [
// 重定向到首页
{
path: '/',
redirect: '/home',
},
// 首页
{
path: '/home',
name: 'Home',
meta: {
title: '首页'
},
component: Home
},
// 下载软件
{
path: '/downLoad',
name: 'DownLoad',
meta: {
title: '软件下载'
},
component: DownLoad
}
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes
})
router.beforeEach((to, from, next) => {
if (to.meta.title) {
document.title = to.meta.title;
}
if (to.name !== from.name) {
next();
}
});
export default router