// router/index.js
import { createRouter, createWebHistory } from 'vue-router';
import ParentComponent from '../components/ParentComponent.vue';
import ChildComponent1 from '../components/ChildComponent1.vue';
import ChildComponent2 from '../components/ChildComponent2.vue';
const routes = [
{
path: '/parent',
component: ParentComponent,
children: [
{
path: 'child1',
component: ChildComponent1
},
{
path: 'child2',
component: ChildComponent2
}
]
}
];
const router = createRouter({
history: createWebHistory(),
routes
});
export default router;