|
1 |
| -import { createRouter, createWebHistory } from 'vue-router'; |
| 1 | +import { createRouter, createWebHistory } from "vue-router"; |
2 | 2 |
|
3 |
| -import AuthenticateRoute from './middleware/AuthenticateRoute'; |
4 |
| -import AuthorizeRoute from './middleware/AuthorizeRoute'; |
5 |
| -import RedirectIfAuthenticated from './middleware/RedirectIfAuthenticated'; |
| 3 | +import AuthenticateRoute from "./middleware/AuthenticateRoute"; |
| 4 | +import AuthorizeRoute from "./middleware/AuthorizeRoute"; |
| 5 | +import RedirectIfAuthenticated from "./middleware/RedirectIfAuthenticated"; |
6 | 6 |
|
7 |
| -import PanelView from '@/views/PanelView.vue'; |
| 7 | +import PanelView from "@/views/PanelView.vue"; |
8 | 8 |
|
9 | 9 | const router = createRouter({
|
10 | 10 | history: createWebHistory(import.meta.env.BASE_URL),
|
11 | 11 | routes: [
|
12 | 12 | {
|
13 |
| - path: '/', |
14 |
| - name: 'Panel', |
| 13 | + path: "/", |
| 14 | + name: "Panel", |
15 | 15 | component: PanelView,
|
16 | 16 | beforeEnter: [AuthenticateRoute],
|
17 | 17 | children: [
|
18 | 18 | {
|
19 |
| - path: 'dashboard', |
20 |
| - name: 'Dashboard', |
21 |
| - component: () => import('@/views/DashboardView.vue'), |
| 19 | + path: "dashboard", |
| 20 | + name: "Dashboard", |
| 21 | + component: () => import("@/views/DashboardView.vue"), |
22 | 22 | beforeEnter: [AuthorizeRoute],
|
23 | 23 | meta: {
|
24 |
| - permissions: ['dashboard'] |
25 |
| - } |
| 24 | + permissions: ["dashboard"], |
| 25 | + }, |
26 | 26 | },
|
27 | 27 | {
|
28 |
| - path: 'users', |
29 |
| - name: 'Users', |
30 |
| - component: () => import('@/views/UsersView.vue') |
| 28 | + path: "users", |
| 29 | + name: "Users", |
| 30 | + component: () => import("@/views/UsersView.vue"), |
31 | 31 | },
|
32 | 32 | {
|
33 |
| - path: 'todos', |
34 |
| - name: 'Todos', |
35 |
| - component: () => import('@/views/TodosView.vue') |
36 |
| - } |
37 |
| - ] |
| 33 | + path: "todos", |
| 34 | + name: "Todos", |
| 35 | + component: () => import("@/views/TodosView.vue"), |
| 36 | + }, |
| 37 | + { |
| 38 | + path:'comments', |
| 39 | + name:"Comments", |
| 40 | + component: () => import('@/views/CommentsView.vue'), |
| 41 | + }, |
| 42 | + |
| 43 | + ], |
38 | 44 | },
|
39 | 45 | {
|
40 |
| - path: '/login', |
41 |
| - name: 'Login', |
| 46 | + path: "/login", |
| 47 | + name: "Login", |
42 | 48 | // route level code-splitting
|
43 | 49 | // this generates a separate chunk (Login.[hash].js) for this route
|
44 | 50 | // which is lazy-loaded when the route is visited.
|
45 |
| - component: () => import('@/views/LoginView.vue'), |
46 |
| - beforeEnter: [RedirectIfAuthenticated] |
47 |
| - } |
48 |
| - ] |
| 51 | + component: () => import("@/views/LoginView.vue"), |
| 52 | + beforeEnter: [RedirectIfAuthenticated], |
| 53 | + }, |
| 54 | + ], |
49 | 55 | });
|
50 | 56 |
|
51 | 57 | export default router;
|
0 commit comments