index.ts 542 B

123456789101112131415161718192021222324
  1. import type { App } from 'vue'
  2. import type { RouteRecordRaw } from 'vue-router'
  3. import { createRouter, createWebHashHistory } from 'vue-router'
  4. import { setupPageGuard } from './permission'
  5. // import { ChatLayout } from '@/views/chat/layout'
  6. const routes: RouteRecordRaw[] = [
  7. ]
  8. export const router = createRouter({
  9. history: createWebHashHistory(),
  10. routes,
  11. scrollBehavior: () => ({ left: 0, top: 0 }),
  12. })
  13. setupPageGuard(router)
  14. export async function setupRouter(app: App) {
  15. app.use(router)
  16. await router.isReady()
  17. }