ZhangXianQiang
2024-06-03 799effa8be2462cde6986cf7e13d9d99b29e8ae6
src/router/index.js
@@ -1,13 +1,29 @@
import { createMemoryHistory, createRouter } from 'vue-router';
import Layout from '@/layout/index.vue';
const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  { path: '/index', component: () => import('@/views/home/index.vue') },
  { path: '/menu', component: () => import('@/views/menu/index.vue') },
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/views/home/index.vue'),
      },
      {
        path: 'menu',
        name: 'menu',
        component: () => import('@/views/menu/index.vue')
      },
    ]
  },
];
const router = createRouter({