-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.ts
47 lines (44 loc) · 975 Bytes
/
index.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
46
47
import { createRouter, createWebHistory } from 'vue-router'
import NewPost from '../components/NewPost.vue'
import ShowPost from '../components/ShowPost.vue'
import Home from '../components/Home.vue'
import EditPost from '../components/EditPost.vue'
import NewUser from '../components/NewUser.vue'
import Login from '../components/Login.vue'
const history = createWebHistory()
const router = createRouter({
history,
routes: [
{
path: '/',
name: '',
component: Home,
},
{
path: '/posts/new',
name: 'new-post',
component: NewPost,
},
{
path: '/posts/:id/edit',
name: 'edit-post',
component: EditPost,
},
{
path: '/posts/:id',
name: 'show-post',
component: ShowPost,
},
{
path: '/users/new',
name: 'user-new',
component: NewUser
},
{
path: '/users/login',
name: 'login',
component: Login
}
]
})
export { router }