Skip to content

Commit e530db2

Browse files
CaptainWang98willxywangScriptedAlchemydanpeen
authored
feat(vue3-bridge): reconstruct nested route (#4117)
Co-authored-by: willxywang <[email protected]> Co-authored-by: Zack Jackson <[email protected]> Co-authored-by: CocooDanielle <[email protected]>
1 parent d225658 commit e530db2

File tree

8 files changed

+692
-19
lines changed

8 files changed

+692
-19
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<template>
2+
<div class="p-4">
3+
<h1 class="text-2xl font-bold mb-4">Settings Page</h1>
4+
<p>This is the settings page for Router Remote 3.</p>
5+
</div>
6+
</template>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<template>
2+
<div class="p-4">
3+
<h1 class="text-2xl font-bold mb-4">Settings Page</h1>
4+
<p>This is the settings page for Router Remote 3.</p>
5+
</div>
6+
</template>

apps/router-demo/router-remote3-2003/src/router.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,28 @@ import {
55
} from 'vue-router';
66
import Home from '@/pages/Home.vue';
77
import Detail from '@/pages/Detail.vue';
8+
import Settings from '@/pages/Settings.vue';
9+
import Profile from '@/pages/Profile.vue';
810

911
const router = createRouter({
1012
history: createWebHistory(),
1113
routes: [
1214
// 在这里定义你的路由
13-
{ path: '/', component: Home },
14-
{ path: '/detail', component: Detail },
15+
{
16+
path: '/',
17+
component: Home,
18+
children: [
19+
{
20+
path: 'profile',
21+
component: Profile,
22+
children: [{ path: 'settings', component: Settings }],
23+
},
24+
],
25+
},
26+
{
27+
path: '/detail',
28+
component: Detail,
29+
},
1530
// 其他路由
1631
],
1732
});

0 commit comments

Comments
 (0)