Skip to content

Instantly share code, notes, and snippets.

@fadingdust
Created March 16, 2018 22:29
Show Gist options
  • Save fadingdust/ea3fef3feb23dc985f4b6a6aba278969 to your computer and use it in GitHub Desktop.
Save fadingdust/ea3fef3feb23dc985f4b6a6aba278969 to your computer and use it in GitHub Desktop.
Basic Vue Router Config from @michaelsoriano
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [ { path: '/', component: Home },
{ path: '/post/:slug', name: 'post', component: Single },
{ path: '/preview/:id', name: 'preview', component: Single },
{ path: '/page/:slug', name: 'page', component: Page },
{ path: '/category/:cat_id', name:'category', component: Archive },
{ path: '/tag/:tag_id', name : 'tag', component: Archive },
{ path: '/blog/', name : 'blog', component: Archive },
{ path: '/search/', name : 'search', component: Search },
{ path: "*", component: PageNotFound }];
const router = new VueRouter({ routes : routes, mode: 'history'})
export default router
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment