Skip to content

Instantly share code, notes, and snippets.

@colinf
Last active March 9, 2017 21:58
Show Gist options
  • Save colinf/e6bf65ec5498066de6d554c19091beab to your computer and use it in GitHub Desktop.
Save colinf/e6bf65ec5498066de6d554c19091beab to your computer and use it in GitHub Desktop.
Defining the routes with vue-router ( see http://j.mp/2m7IauQ )
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