add 2 layer route

This commit is contained in:
AceDataCloud committed 2021-08-28 13:30:42 +08:00
1 parent df9ac27be6
commit 9091f41012
10 files changed
+32 -23

No files matched your search

+13 -5
View File
@@ -1,4 +1,4 @@
import { createRouter, createWebHistory } from 'vue-router';
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
const routes = [
{
@@ -7,14 +7,22 @@ const routes = [
component: () => import('@/pages/Home.vue')
},
{
path: '/editor',
name: 'editor',
component: () => import('@/pages/Editor.vue')
path: '/content',
name: 'content',
component: () => import('@/layouts/Content.vue'),
children: [
{
path: 'editor',
name: 'editor',
component: () => import('@/pages/content/Editor.vue')
}
]
}
];
const router = createRouter({
history: createWebHistory(),
// history: createWebHistory(),
history: createWebHashHistory(),
routes
});
export default router;