Skip to content

Commit fd80478

Browse files
committed
feat(Views):Initialize comments page and add its route in router file
1 parent 150a7c7 commit fd80478

File tree

2 files changed

+41
-26
lines changed

2 files changed

+41
-26
lines changed

src/router/index.js

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,57 @@
1-
import { createRouter, createWebHistory } from 'vue-router';
1+
import { createRouter, createWebHistory } from "vue-router";
22

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";
66

7-
import PanelView from '@/views/PanelView.vue';
7+
import PanelView from "@/views/PanelView.vue";
88

99
const router = createRouter({
1010
history: createWebHistory(import.meta.env.BASE_URL),
1111
routes: [
1212
{
13-
path: '/',
14-
name: 'Panel',
13+
path: "/",
14+
name: "Panel",
1515
component: PanelView,
1616
beforeEnter: [AuthenticateRoute],
1717
children: [
1818
{
19-
path: 'dashboard',
20-
name: 'Dashboard',
21-
component: () => import('@/views/DashboardView.vue'),
19+
path: "dashboard",
20+
name: "Dashboard",
21+
component: () => import("@/views/DashboardView.vue"),
2222
beforeEnter: [AuthorizeRoute],
2323
meta: {
24-
permissions: ['dashboard']
25-
}
24+
permissions: ["dashboard"],
25+
},
2626
},
2727
{
28-
path: 'users',
29-
name: 'Users',
30-
component: () => import('@/views/UsersView.vue')
28+
path: "users",
29+
name: "Users",
30+
component: () => import("@/views/UsersView.vue"),
3131
},
3232
{
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+
],
3844
},
3945
{
40-
path: '/login',
41-
name: 'Login',
46+
path: "/login",
47+
name: "Login",
4248
// route level code-splitting
4349
// this generates a separate chunk (Login.[hash].js) for this route
4450
// 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+
],
4955
});
5056

5157
export default router;

src/views/CommentsView.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script lang="ts" setup>
2+
3+
</script>
4+
5+
<template>
6+
<div>
7+
<h1>Comments Page</h1>
8+
</div>
9+
</template>

0 commit comments

Comments
 (0)