File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 4
4
< meta charset ="UTF-8 ">
5
5
< link rel ="icon " href ="/favicon.ico ">
6
6
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7
- < title > Vite App </ title >
7
+ < title > Newbie JVM Playground </ title >
8
8
</ head >
9
9
< body >
10
10
< div id ="app "> </ div >
Original file line number Diff line number Diff line change @@ -7,15 +7,38 @@ const router = createRouter({
7
7
routes : [
8
8
{
9
9
path : '/' ,
10
+ redirect : '/memory-visualizer' ,
11
+ } ,
12
+ {
13
+ path : '/memory-visualizer' ,
10
14
name : 'memory-visualizer' ,
11
15
component : MemoryVisualizer ,
16
+ meta : {
17
+ title : '内存可视化'
18
+ }
12
19
} ,
13
20
{
14
21
path : '/bytecode-viewer' ,
15
22
name : 'bytecode-viewer' ,
16
23
component : BytecodeViewer ,
24
+ meta : {
25
+ title : '字节码查看器'
26
+ }
17
27
}
18
28
] ,
19
29
} )
20
30
31
+ // 添加全局前置守卫
32
+ router . beforeEach ( ( to ) => {
33
+ // 获取最接近的带有 title 的路由记录
34
+ const nearestWithTitle = to . matched . slice ( ) . reverse ( ) . find ( r => r . meta ?. title )
35
+
36
+ // 设置页面标题
37
+ if ( nearestWithTitle ?. meta . title ) {
38
+ document . title = nearestWithTitle . meta . title + ' - Newbie JVM Playground'
39
+ } else {
40
+ document . title = 'Newbie JVM Playground' // 设置默认标题
41
+ }
42
+ } )
43
+
21
44
export default router
Original file line number Diff line number Diff line change @@ -169,6 +169,15 @@ const jvmArgsHelp = [
169
169
}
170
170
];
171
171
172
+ // JVM 规范
173
+ const jvmStandard = [
174
+ {
175
+ " id" : " " ,
176
+ " desc" : " " ,
177
+ " source" : " "
178
+ }
179
+ ]
180
+
172
181
const showArgsHelp = () => {
173
182
showHelpModal .value = true ;
174
183
};
You can’t perform that action at this time.
0 commit comments