Skip to content

Instantly share code, notes, and snippets.

@renzon
Created January 20, 2021 14:18
Show Gist options
  • Save renzon/f67dce3618b23e62f2ec93b55565e3c3 to your computer and use it in GitHub Desktop.
Save renzon/f67dce3618b23e62f2ec93b55565e3c3 to your computer and use it in GitHub Desktop.
import Vue from 'vue'
import Router from 'vue-router'
import Index from '~/pages/index.vue'
import Perfil from '~/pages/perfil.vue'
import User from '~/pages/user/_username/index.vue'
import Todos from '~/pages/todos.vue'
Vue.use(Router)
export const routerOptions = {
mode: 'history',
routes: [
{path: '/', component: Index, name: 'index'},
{path: '/perfil', component: Perfil, name: 'perfil'},
{path: '/user/:username', component: User, name: 'user'},
{path: '/todos', component: Todos, name: 'todos'}
]
}
export function createRouter (ctx) {
return new Router(routerOptions)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment