-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ userStore.userinfo }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ userStore.userinfo }}
diff --git a/src/plugins/autofit.ts b/src/plugins/autofit.ts
index 0deffb2..59748d0 100644
--- a/src/plugins/autofit.ts
+++ b/src/plugins/autofit.ts
@@ -11,5 +11,8 @@ export const autoFit = () => {
dw: 1920,
el: 'body',
resize: true,
+ transition: 0.49,
+ limit: 0.1,
+ allowScroll: false,
});
};
diff --git a/src/router/index.ts b/src/router/index.ts
index c0ae6f7..1499403 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -1,48 +1,12 @@
import type { App } from 'vue';
import { createRouter, createWebHashHistory, type RouteRecordRaw } from 'vue-router';
-export const Layout = () => import('@/layout/index.vue');
+import error from '@/router/modules/error';
+import home from '@/router/modules/home';
+import remaining from '@/router/modules/remaining';
// 静态路由
-const routes: RouteRecordRaw[] = [
- {
- path: '/redirect',
- component: Layout,
- meta: { hidden: true },
- children: [
- {
- path: '/redirect/:path(.*)',
- component: () => import('@/views/redirect/index.vue'),
- },
- ],
- },
- {
- path: '/',
- name: '/',
- component: Layout,
- // redirect: '/dashboard',
- children: [
- // {
- // path: 'dashboard',
- // component: () => import('@/views/index.vue'),
- // // 用于 keep-alive 功能,需要与 SFC 中自动推导或显式声明的组件名称一致
- // // 参考文档: https://cn.vuejs.org/guide/built-ins/keep-alive.html#include-exclude
- // name: 'Dashboard',
- // meta: {
- // title: 'dashboard',
- // icon: 'homepage',
- // affix: true,
- // keepAlive: true,
- // },
- // },
- ],
- },
- {
- path: '/404',
- component: () => import('@/views/error-page/404.vue'),
- meta: { hidden: true },
- },
-];
+const routes: RouteRecordRaw[] = [...remaining, ...home, ...error];
const router = createRouter({
history: createWebHashHistory(),
routes,
@@ -58,4 +22,5 @@ export const setUpRouter = (app: App
) => {
export const resetRouter = () => {
router.replace({ path: '/' }).then();
};
+
export default router;
diff --git a/src/router/modules/error.ts b/src/router/modules/error.ts
new file mode 100644
index 0000000..0a1ec66
--- /dev/null
+++ b/src/router/modules/error.ts
@@ -0,0 +1,11 @@
+import type { RouteRecordRaw } from 'vue-router';
+
+const routes: RouteRecordRaw[] = [
+ {
+ path: '/error',
+ component: () => import('@/views/error-page/404.vue'),
+ meta: { hidden: true },
+ },
+];
+
+export default routes;
diff --git a/src/router/modules/home.ts b/src/router/modules/home.ts
new file mode 100644
index 0000000..4371a95
--- /dev/null
+++ b/src/router/modules/home.ts
@@ -0,0 +1,14 @@
+import type { RouteRecordRaw } from 'vue-router';
+
+import Layout from '@/layout/index.vue';
+
+const routes: RouteRecordRaw[] = [
+ {
+ path: '/',
+ name: '/',
+ component: Layout,
+ meta: { transition: 'fade' },
+ },
+];
+
+export default routes;
diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts
new file mode 100644
index 0000000..5e17fcb
--- /dev/null
+++ b/src/router/modules/remaining.ts
@@ -0,0 +1,19 @@
+import type { RouteRecordRaw } from 'vue-router';
+
+import Layout from '@/layout/index.vue';
+
+const routes: RouteRecordRaw[] = [
+ {
+ path: '/redirect',
+ component: Layout,
+ meta: { hidden: true },
+ children: [
+ {
+ path: '/redirect/:path(.*)',
+ component: () => import('@/views/redirect/index.vue'),
+ },
+ ],
+ },
+];
+
+export default routes;