Library/frontend/src/router/index.js

74 lines
1.5 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 Authors from '@/components/Authors'
import AuthorsAddEdit from '@/components/AuthorsAddEdit'
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: '/authors',
name: 'authors',
component: Authors
},
{
path: '/authors/add',
name: 'authors-add',
component: AuthorsAddEdit
},
{
path: '/authors/:id/edit',
name: 'author-edit',
component: AuthorsAddEdit
},
{
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'
})