mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
e7cc2757c3
Co-authored-by: Alexander Lichter <manniL@gmx.net>
32 lines
689 B
JavaScript
32 lines
689 B
JavaScript
import Vue from 'vue'
|
|
import Router from 'vue-router'
|
|
|
|
Vue.use(Router)
|
|
|
|
const indexPage = () => import('~/views/index.vue').then(m => m.default || m)
|
|
const aboutPage = () => import('~/views/about.vue').then(m => m.default || m)
|
|
const layoutPage = () => import('~/views/layout.vue').then(m => m.default || m)
|
|
|
|
export function createRouter () {
|
|
return new Router({
|
|
mode: 'history',
|
|
routes: [
|
|
{
|
|
path: '/',
|
|
component: indexPage,
|
|
name: 'index'
|
|
},
|
|
{
|
|
path: '/about',
|
|
component: aboutPage,
|
|
name: 'about'
|
|
},
|
|
{
|
|
path: '/layout',
|
|
component: layoutPage,
|
|
name: 'layout'
|
|
}
|
|
]
|
|
})
|
|
}
|