- Edit
- components/HelloWorld.vue
to test HMR
-
- Check out - create-vue, the official Vue + Vite starter -
-- Install - Volar - in your IDE for a better DX -
-Click on the Vite and Vue logos to learn more
- - - diff --git a/src/router/index.js b/src/router/index.js index a2b8690..b1e69ec 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,22 +3,32 @@ import { createRouter, createWebHistory } from 'vue-router'; const routes = [ { path: '/', - name: 'commonpage', - redirect: '/home', + redirect: 'home' + }, + { + path: '/home', + name: 'home', component: () => import('@/views/layout.vue'), children: [ { - path: '/home', - name: 'home', - component: () => import('@/views/home/index.vue') - }, + path: 'navigation', + name: 'navigation', + component: () => import('@/views/navigation/index.vue'), + } + ] + }, + { + path: '/about', + name: 'about', + component: () => import('@/views/layout.vue'), + children: [ { path: '/about1', name: 'about1', component: () => import('@/views/about/index.vue') }, ] - } + }, // 添加其他路由配置... ]; diff --git a/src/views/navigation/index.vue b/src/views/navigation/index.vue new file mode 100644 index 0000000..bb2ff13 --- /dev/null +++ b/src/views/navigation/index.vue @@ -0,0 +1,13 @@ + + + +