Library/frontend/src/router/index.js

46 lines
869 B
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'
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
}
],
linkActiveClass: 'active'
})