|
1 | 1 | import { createRouter, createWebHashHistory } from 'vue-router' |
2 | 2 |
|
| 3 | +export const RouterName = { |
| 4 | + main: 'main', |
| 5 | + preferences: 'preferences', |
| 6 | + preferencesStorage: 'preferences/storage', |
| 7 | + preferencesLanguage: 'preferences/language', |
| 8 | + preferencesAppearance: 'preferences/appearance', |
| 9 | + preferencesEditor: 'preferences/editor', |
| 10 | + markdownPresentation: 'markdown-presentation', |
| 11 | +} |
| 12 | + |
3 | 13 | const routes = [ |
4 | 14 | { |
5 | 15 | path: '/', |
6 | | - name: 'main', |
| 16 | + name: RouterName.main, |
7 | 17 | component: () => import('@/views/Main.vue'), |
8 | 18 | }, |
9 | 19 | { |
10 | 20 | path: '/preferences', |
11 | | - name: 'preferences', |
| 21 | + name: RouterName.preferences, |
12 | 22 | component: () => import('@/views/Preferences.vue'), |
13 | 23 | children: [ |
14 | 24 | { |
15 | 25 | path: 'storage', |
16 | | - name: 'preferences/storage', |
| 26 | + name: RouterName.preferencesStorage, |
17 | 27 | component: () => import('@/components/preferences/Storage.vue'), |
18 | 28 | }, |
19 | 29 | { |
20 | 30 | path: 'language', |
21 | | - name: 'preferences/language', |
| 31 | + name: RouterName.preferencesLanguage, |
22 | 32 | component: () => import('@/components/preferences/Language.vue'), |
23 | 33 | }, |
24 | 34 | { |
25 | 35 | path: 'appearance', |
26 | | - name: 'preferences/appearance', |
| 36 | + name: RouterName.preferencesAppearance, |
27 | 37 | component: () => import('@/components/preferences/Appearance.vue'), |
28 | 38 | }, |
29 | 39 | { |
30 | 40 | path: 'editor', |
31 | | - name: 'preferences/editor', |
| 41 | + name: RouterName.preferencesEditor, |
32 | 42 | component: () => import('@/components/preferences/Editor.vue'), |
33 | 43 | }, |
34 | 44 | ], |
35 | 45 | }, |
36 | 46 | { |
37 | 47 | path: '/markdown-presentation', |
38 | | - name: 'markdown-presentation', |
| 48 | + name: RouterName.markdownPresentation, |
39 | 49 | component: () => import('@/views/MarkdownPresentation.vue'), |
40 | 50 | }, |
41 | 51 | ] |
|
0 commit comments