chore: give names for all routes

This commit is contained in:
Sándor Levcsák 2020-10-14 19:11:36 +03:00
parent 1101236d3a
commit 190c2890bb
1 changed files with 50 additions and 8 deletions

View File

@ -15,14 +15,56 @@ export type AppRouteNames = 'global-feed'
const router = createRouter({
history: createWebHashHistory(),
routes: [
{ path: '/', component: Home },
{ path: '/my-feeds', component: Home },
{ path: '/tag/:tag', component: Home },
{ path: '/article/:slug', component: () => import('./pages/Article.vue') },
{ path: '/login', component: () => import('./pages/Login.vue') },
{ path: '/register', component: () => import('./pages/Register.vue') },
{ path: '/profile/:username', component: () => import('./pages/Profile.vue') },
{ path: '/profile/:username/favorites', component: () => import('./pages/Profile.vue') },
{
name: 'global-feed',
path: '/',
component: Home,
},
{
name: 'my-feed',
path: '/my-feeds',
component: Home,
},
{
name: 'tag',
path: '/tag/:tag',
component: Home,
},
{
name: 'article',
path: '/article/:slug',
component: () => import('./pages/Article.vue'),
},
{
name: 'login',
path: '/login',
component: () => import('./pages/Login.vue'),
},
{
name: 'register',
path: '/register',
component: () => import('./pages/Register.vue'),
},
{
name: 'profile',
path: '/profile/:username',
component: () => import('./pages/Profile.vue'),
},
{
name: 'profile-favorites',
path: '/profile/:username/favorites',
component: () => import('./pages/Profile.vue'),
},
{
name: 'editor',
path: '/editor',
redirect: '/',
},
{
name: 'settings',
path: '/settings',
redirect: '/',
},
],
})