Skip to content

Instantly share code, notes, and snippets.

@BartoszBilejczyk
Last active September 21, 2020 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BartoszBilejczyk/e95edf001b5d83755f27f51216dfef95 to your computer and use it in GitHub Desktop.
Save BartoszBilejczyk/e95edf001b5d83755f27f51216dfef95 to your computer and use it in GitHub Desktop.
import { createRouter, createWebHistory } from "vue-router";
const routes = [
{
path: '/dashboard',
name: 'Dashboard',
component: () =>
import(/* webpackChunkName: 'dashboard' */ '../views/Dashboard.vue')
},
{
path: '/:pathMatch(.*)*',
redirect: () => '/dashboard'
}
];
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
routes
});
export default router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment