Skip to content

Instantly share code, notes, and snippets.

@BartoszBilejczyk
Last active September 21, 2020 09:26
Show Gist options
  • 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