86 lines
1.8 KiB
JavaScript
86 lines
1.8 KiB
JavaScript
import Vue from 'vue'
|
|
import Router from 'vue-router'
|
|
import Home from '@/components/Home'
|
|
import Login from '@/components/Login'
|
|
import Books from '@/components/Books'
|
|
import BooksAddEdit from '@/components/BooksAddEdit'
|
|
import BookOverview from '@/components/BookOverview'
|
|
import Authors from '@/components/Authors'
|
|
import AuthorsAddEdit from '@/components/AuthorsAddEdit'
|
|
import AuthorOverview from '@/components/AuthorOverview'
|
|
import Publishers from '@/components/Publishers'
|
|
import PublishersAddEdit from '@/components/PublishersAddEdit'
|
|
|
|
Vue.use(Router)
|
|
|
|
export default new Router({
|
|
routes: [
|
|
{
|
|
path: '/home',
|
|
name: 'home',
|
|
component: Home
|
|
},
|
|
{
|
|
path: '/login',
|
|
name: 'login',
|
|
component: Login
|
|
},
|
|
{
|
|
path: '/books',
|
|
name: 'books',
|
|
component: Books
|
|
},
|
|
{
|
|
path: '/books/add',
|
|
name: 'add-book',
|
|
component: BooksAddEdit
|
|
},
|
|
{
|
|
path: '/books/:id/edit',
|
|
name: 'book-edit',
|
|
component: BooksAddEdit
|
|
},
|
|
{
|
|
path: '/books/:id',
|
|
name: 'book-show',
|
|
component: BookOverview
|
|
},
|
|
{
|
|
path: '/authors',
|
|
name: 'authors',
|
|
component: Authors
|
|
},
|
|
{
|
|
path: '/authors/add',
|
|
name: 'authors-add',
|
|
component: AuthorsAddEdit
|
|
},
|
|
{
|
|
path: '/authors/:id/edit',
|
|
name: 'author-edit',
|
|
component: AuthorsAddEdit
|
|
},
|
|
{
|
|
path: '/authors/:id',
|
|
name: 'author-show',
|
|
component: AuthorOverview
|
|
},
|
|
{
|
|
path: '/publishers',
|
|
name: 'publishers',
|
|
component: Publishers
|
|
},
|
|
{
|
|
path: '/publishers/add',
|
|
name: 'publishers-add',
|
|
component: PublishersAddEdit
|
|
},
|
|
{
|
|
path: '/publishers/:id/edit',
|
|
name: 'publisher-edit',
|
|
component: PublishersAddEdit
|
|
}
|
|
],
|
|
linkActiveClass: 'active'
|
|
})
|