/
routes.ts
45 lines (42 loc) · 1.2 KB
/
routes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { RouteRecordRaw } from "vue-router";
const routes: RouteRecordRaw[] = [
{
path: "/",
component: () => import("layouts/MainLayout.vue"),
children: [
{
path: "",
name: "home",
component: () => import("pages/Index.vue"),
meta: { title: "Home", showDefaultTitle: false },
},
{
path: "/contacts/new",
name: "new_contact",
component: () => import("pages/contacts/CreateContact.vue"),
meta: { title: "New Contact", showDefaultTitle: true },
},
{
path: "contacts/:contactId/details",
name: "view_contact",
component: () => import("pages/contacts/ViewContact.vue"),
meta: { title: "View Contact", showDefaultTitle: false },
props: true,
},
{
path: "contacts/:contactId/edit",
name: "edit_contact",
component: () => import("pages/contacts/EditContact.vue"),
meta: { title: "Edit Contact", showDefaultTitle: true },
props: true,
},
],
},
// Always leave this as last one,
// but you can also remove it
{
path: "/:catchAll(.*)*",
component: () => import("pages/Error404.vue"),
},
];
export default routes;