constantRouter.ts 826 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import BlankLayout from '@/layouts/BlankLayout.vue'
  2. import BasicLayout from '@/layouts/BasicLayout.vue'
  3. import type { RouteRecordRaw } from 'vue-router'
  4. const constantRouter: RouteRecordRaw[] = [
  5. {
  6. path: '/',
  7. name: 'layout',
  8. component: BasicLayout,
  9. redirect: '/home',
  10. children: [
  11. {
  12. path: 'home',
  13. name: 'home',
  14. component: () => import('@/views/HomeView.vue'),
  15. meta: {
  16. title: '首页'
  17. }
  18. },
  19. {
  20. path: 'about',
  21. name: 'about',
  22. component: () => import('@/views/AboutView.vue'),
  23. meta: {
  24. title: '关于我们'
  25. }
  26. }
  27. ]
  28. },
  29. // 登录之后才能访问的页面
  30. {
  31. path: '/admin',
  32. name: 'admin',
  33. component: BlankLayout,
  34. children: []
  35. }
  36. ]
  37. export default constantRouter