Last active
March 9, 2017 21:58
-
-
Save colinf/e6bf65ec5498066de6d554c19091beab to your computer and use it in GitHub Desktop.
Defining the routes with vue-router ( see http://j.mp/2m7IauQ )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import Router from 'vue-router' | |
import TeamList from '../components/TeamList.vue' | |
import TeamDetailWrapper from '../components/TeamDetailWrapper.vue' | |
import About from '../components/About.vue' | |
import Home from '../components/Home.vue' | |
import NotFoundComponent from '../components/NotFoundComponent.vue' | |
Vue.use(Router) | |
export default new Router({ | |
mode: 'history', | |
routes: [ | |
{ | |
path: '/', | |
component: Home | |
}, | |
{ | |
path: '/about', | |
component: About | |
}, | |
{ | |
path: '/teams', | |
component: TeamList | |
}, | |
{ | |
path: '/teams/:id', | |
components: { | |
default: TeamList, | |
detail: TeamDetailWrapper | |
}, | |
props: { | |
detail: true | |
} | |
}, | |
{ path: '*', | |
component: NotFoundComponent | |
} | |
] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment