Created
March 16, 2018 22:29
-
-
Save fadingdust/ea3fef3feb23dc985f4b6a6aba278969 to your computer and use it in GitHub Desktop.
Basic Vue Router Config from @michaelsoriano
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 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