Skip to content

Instantly share code, notes, and snippets.

@renzon

renzon/router.js

Created Jan 20, 2021
Embed
What would you like to do?
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