Browse Source

优化路由自动处理
Signed-off-by: Caner <5658514@qq.com>

Caner 3 years ago
parent
commit
4bc4c884bf
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/pages/index/main.ts

+ 1 - 1
src/pages/index/main.ts

@@ -5,7 +5,7 @@ import naive from './assets/js/nativeUiPluginPublic'
 import { createRouter, createWebHashHistory } from 'vue-router'
 import { createRouter, createWebHashHistory } from 'vue-router'
 import '@/utils/rem'
 import '@/utils/rem'
 // 动态路由
 // 动态路由
-const routes = Object.values(import.meta.glob('./views/*/route.ts', { eager: true })).map((m) => (m as any).default || m)
+const routes = Object.values(import.meta.glob('./views/*/route.ts', { eager: true, import: 'default' }))
 routes.push({ path: '/:path(.*)', redirect: '/' })
 routes.push({ path: '/:path(.*)', redirect: '/' })
 const store = createPinia()
 const store = createPinia()
 const app = createApp(App)
 const app = createApp(App)