Browse Source

Signed-off-by: Caner <5658514@qq.com>

Caner 3 years ago
parent
commit
ac61fe3269
2 changed files with 3 additions and 5 deletions
  1. 1 1
      .eslintrc.json
  2. 2 4
      src/pages/index/main.ts

+ 1 - 1
.eslintrc.json

@@ -55,6 +55,6 @@
     "no-sparse-arrays": 0,
     "no-nested-ternary": 0,
     "no-continue": 0,
-    "complexity": [ 2, 5 ]
+    "complexity": [ 2, 9 ]
   }
 }

+ 2 - 4
src/pages/index/main.ts

@@ -2,13 +2,11 @@ import { createApp } from 'vue'
 import App from './App.vue'
 import { createPinia } from 'pinia'
 import naive from './assets/js/nativeUiPluginPublic'
-import { createRouter, createWebHashHistory } from 'vue-router'
+import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
 import '@/utils/rem'
 // 动态路由
-const routes = Object.values(import.meta.glob('./views/*/route.ts', { eager: true, import: 'default' }))
+const routes = Object.values(import.meta.glob('./views/*/route.ts', { eager: true, import: 'default' })) as unknown as RouteRecordRaw[]
 routes.push({ path: '/:path(.*)', redirect: '/' })
-console.log(123, routes)
-
 const store = createPinia()
 const app = createApp(App)
 const router = createRouter({