Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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