33 lines
582 B
JavaScript
33 lines
582 B
JavaScript
import Vue from 'vue'
|
|
import Router from 'vue-router'
|
|
import index from '@/pages/index'
|
|
import topic from '@/pages/topic'
|
|
import book from '@/pages/book'
|
|
import p404 from '@/pages/p404'
|
|
|
|
const routes = [
|
|
{path: '/', name: 'index', component: index},
|
|
{
|
|
path: '/book',
|
|
name: 'book',
|
|
component: book,
|
|
children: [
|
|
{path: 'topic', component: topic}
|
|
]
|
|
|
|
},
|
|
{path: '*', component: p404}
|
|
]
|
|
|
|
// const routes = routerOptions.map(route => {
|
|
// return {
|
|
// ...route
|
|
// }
|
|
// })
|
|
|
|
Vue.use(Router)
|
|
export default new Router({
|
|
routes,
|
|
mode: 'history'
|
|
})
|