From 50ee7232f3c98fe24a1f2e31dba9508cfec14887 Mon Sep 17 00:00:00 2001 From: gjj <Ganjj@probim.com.cn> Date: Fri, 21 Feb 2025 17:35:39 +0800 Subject: [PATCH] 模型预览 --- src/router/index.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..a5ef209 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,45 @@ +/* + * @Author: gjj Ganjj@probim.com.cn + * @Date: 2025-02-14 14:32:19 + * @LastEditors: gjj Ganjj@probim.com.cn + * @LastEditTime: 2025-02-18 15:25:13 + * @FilePath: \北京交通大学\src\router\index.js + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import Vue from "vue"; +import VueRouter from "vue-router"; + +import NProgress from "nprogress"; +import "nprogress/nprogress.css"; + + + +// 注册路由插件 +Vue.use(VueRouter); + +const routes = [{ + path: "/", + redirect: "/home", + }, + { + path: "/home", + component: () => + import ("../views/Home.vue") + }, +]; + +const router = new VueRouter({ + routes, + mode: "hash", +}); + +router.beforeEach((to, from, next) => { + NProgress.start(); + next(); +}); + +router.afterEach((to) => { + NProgress.done(); +}); + +export default router; \ No newline at end of file -- Gitblit v1.9.3