/ src / renderer / router / index.ts
index.ts
 1  import { McpScreen, ChatScreen, AgentScreen, SettingScreen } from '@/renderer/screens'
 2  import { createRouter, createWebHashHistory } from 'vue-router'
 3  import { DefaultLayout } from '@/renderer/components/layouts'
 4  
 5  export default createRouter({
 6    history: createWebHashHistory(),
 7    routes: [
 8      {
 9        path: '/popup',
10        component: () => import('@/renderer/screens/PopupScreen.vue')
11      },
12  
13      {
14        path: '/',
15        component: DefaultLayout,
16        children: [
17          {
18            path: '',
19            components: McpScreen,
20            meta: {
21              titleKey: 'title.main'
22            }
23          },
24          {
25            path: 'chat',
26            components: ChatScreen,
27            meta: {
28              titleKey: 'title.chat'
29            }
30          },
31          {
32            path: 'agent',
33            components: AgentScreen,
34            meta: {
35              titleKey: 'title.agent'
36            }
37          },
38          {
39            path: 'setting',
40            components: SettingScreen,
41            meta: {
42              titleKey: 'title.setting'
43            }
44          }
45        ]
46      },
47      // {
48      //   path: '/',
49      //   components: McpScreen,
50      //   meta: {
51      //     titleKey: 'title.main'
52      //   }
53      // },
54      // {
55      //   path: '/chat',
56      //   components: ChatScreen,
57      //   meta: {
58      //     titleKey: 'title.chat'
59      //   }
60      // },
61      // {
62      //   path: '/agent',
63      //   components: AgentScreen,
64      //   meta: {
65      //     titleKey: 'title.agent'
66      //   }
67      // },
68      // {
69      //   path: '/setting',
70      //   components: SettingScreen,
71      //   meta: {
72      //     titleKey: 'title.setting'
73      //   }
74      // },
75      {
76        path: '/error',
77        component: () => import('@/renderer/screens/ErrorScreen.vue'),
78        meta: {
79          titleKey: 'title.error'
80        }
81      },
82      {
83        path: '/:pathMatch(.*)*',
84        redirect: '/'
85      }
86    ]
87  })