Library/frontend/src/router/index.js

46 lines
869 B
JavaScript
Raw Normal View History

2017-11-09 09:31:03 +00:00
import Vue from 'vue'
import Router from 'vue-router'
2017-11-09 11:19:53 +00:00
import Home from '@/components/Home'
import Login from '@/components/Login'
2017-11-09 14:12:04 +00:00
import Books from '@/components/Books'
import BooksAddEdit from '@/components/BooksAddEdit'
2017-11-21 10:16:07 +00:00
import Authors from '@/components/Authors'
2017-11-09 09:31:03 +00:00
Vue.use(Router)
export default new Router({
routes: [
{
2017-11-09 11:19:53 +00:00
path: '/home',
2017-11-17 13:07:41 +00:00
name: 'home',
2017-11-09 11:19:53 +00:00
component: Home
},
{
path: '/login',
2017-11-17 13:07:41 +00:00
name: 'login',
2017-11-09 11:19:53 +00:00
component: Login
2017-11-09 14:12:04 +00:00
},
{
path: '/books',
2017-11-17 13:07:41 +00:00
name: 'books',
2017-11-09 14:12:04 +00:00
component: Books
},
{
path: '/books/add',
2017-11-17 13:07:41 +00:00
name: 'add-book',
component: BooksAddEdit
},
{
path: '/books/:id/edit',
name: 'book-edit',
component: BooksAddEdit
2017-11-21 10:16:07 +00:00
},
{
path: '/authors',
name: 'authors',
component: Authors
2017-11-09 09:31:03 +00:00
}
2017-11-09 15:27:43 +00:00
],
linkActiveClass: 'active'
2017-11-09 09:31:03 +00:00
})