@@ -34,85 +34,100 @@ import {
3434 ThunderboltOutlined ,
3535 ToolOutlined ,
3636} from '@ant-design/icons'
37- import { t } from 'i18next' // 注意:这里可能需要处理 i18n
3837
3938// 静态菜单配置
4039// 这里的 key 对应路由 path
4140const rawMainLayoutMenu = [
4241 { label : 'home' , i18nKey : 'home' , key : '/' , icon : < HomeOutlined /> } ,
4342 { label : 'demo' , i18nKey : 'demo' , key : '/demo' , icon : < GlobalOutlined /> } ,
44- { label : 'Motion' , key : '/motion' , icon : < RocketOutlined /> } ,
45- { label : 'Mermaid' , key : '/mermaid' , icon : < ProjectOutlined /> } ,
46- { label : 'Topology' , key : '/topology' , icon : < DeploymentUnitOutlined /> } ,
47- { label : '权限示例' , key : '/permission' , icon : < LockOutlined /> } ,
48- { label : 'PH Bar' , key : '/ph-bar' , icon : < BarChartOutlined /> } ,
49- { label : 'ChatGPT' , key : '/markmap' , icon : < RobotOutlined /> } ,
50- { label : 'React Tilt' , key : '/tilt' , icon : < ExperimentOutlined /> } ,
51- { label : 'Music' , key : '/music' , icon : < SoundOutlined /> } ,
52- { label : 'Crypto' , key : '/crypto' , icon : < LockOutlined /> } ,
53- { label : 'Video' , key : '/video' , icon : < VideoCameraOutlined /> } ,
54- { label : 'Big Screen' , key : '/big-screen' , icon : < FundProjectionScreenOutlined /> } ,
55- { label : 'Echarts' , key : '/echarts' , icon : < PieChartOutlined /> } ,
56- { label : 'Qr Generate' , key : '/qrcode' , icon : < QrcodeOutlined /> } ,
57- { label : 'Business' , key : '/business' , icon : < BankOutlined /> } ,
58- { label : 'Prism Render' , key : '/prism' , icon : < HighlightOutlined /> } ,
59- { label : 'Post Message' , key : '/postmessage' , icon : < SendOutlined /> } ,
60- { label : 'Geo Chart' , key : '/geo' , icon : < EnvironmentOutlined /> } ,
61- { label : 'D3 Chart' , key : '/d3-chart' , icon : < DotChartOutlined /> } ,
62- { label : 'Print' , key : '/print' , icon : < PrinterOutlined /> } ,
63- { label : 'Profile' , key : '/profile' , icon : < UserOutlined /> } ,
64- { label : 'Contact' , key : '/contact' , icon : < ContactsOutlined /> } ,
43+ { label : 'Motion' , i18nKey : 'menu.motion' , key : '/motion' , icon : < RocketOutlined /> } ,
44+ { label : 'Mermaid' , i18nKey : 'menu.mermaid' , key : '/mermaid' , icon : < ProjectOutlined /> } ,
45+ { label : 'Topology' , i18nKey : 'menu.topology' , key : '/topology' , icon : < DeploymentUnitOutlined /> } ,
46+ { label : '权限示例' , i18nKey : 'menu.permissionExample' , key : '/permission' , icon : < LockOutlined /> } ,
47+ { label : 'PH Bar' , i18nKey : 'menu.phBar' , key : '/ph-bar' , icon : < BarChartOutlined /> } ,
48+ { label : 'ChatGPT' , i18nKey : 'menu.chatgpt' , key : '/markmap' , icon : < RobotOutlined /> } ,
49+ { label : 'React Tilt' , i18nKey : 'menu.reactTilt' , key : '/tilt' , icon : < ExperimentOutlined /> } ,
50+ { label : 'Music' , i18nKey : 'menu.music' , key : '/music' , icon : < SoundOutlined /> } ,
51+ { label : 'Crypto' , i18nKey : 'menu.crypto' , key : '/crypto' , icon : < LockOutlined /> } ,
52+ { label : 'Video' , i18nKey : 'menu.video' , key : '/video' , icon : < VideoCameraOutlined /> } ,
53+ { label : 'Big Screen' , i18nKey : 'menu.bigScreen' , key : '/big-screen' , icon : < FundProjectionScreenOutlined /> } ,
54+ { label : 'Echarts' , i18nKey : 'menu.echarts' , key : '/echarts' , icon : < PieChartOutlined /> } ,
55+ { label : 'Qr Generate' , i18nKey : 'menu.qrGenerate' , key : '/qrcode' , icon : < QrcodeOutlined /> } ,
56+ { label : 'Business' , i18nKey : 'menu.business' , key : '/business' , icon : < BankOutlined /> } ,
57+ { label : 'Prism Render' , i18nKey : 'menu.prismRender' , key : '/prism' , icon : < HighlightOutlined /> } ,
58+ { label : 'Post Message' , i18nKey : 'menu.postMessage' , key : '/postmessage' , icon : < SendOutlined /> } ,
59+ { label : 'Geo Chart' , i18nKey : 'menu.geoChart' , key : '/geo' , icon : < EnvironmentOutlined /> } ,
60+ { label : 'D3 Chart' , i18nKey : 'menu.d3Chart' , key : '/d3-chart' , icon : < DotChartOutlined /> } ,
61+ { label : 'Print' , i18nKey : 'menu.print' , key : '/print' , icon : < PrinterOutlined /> } ,
62+ { label : 'Profile' , i18nKey : 'menu.profile' , key : '/profile' , icon : < UserOutlined /> } ,
63+ { label : 'Contact' , i18nKey : 'menu.contact' , key : '/contact' , icon : < ContactsOutlined /> } ,
6564 {
6665 label : '前端技术栈' ,
66+ i18nKey : 'menu.frontendTechStack' ,
6767 key : '/tech/frontend' ,
6868 icon : < DeploymentUnitOutlined /> ,
6969 children : [
70- { label : 'React' , key : '/tech/frontend/react' , icon : < CodeOutlined /> } ,
70+ { label : 'React' , i18nKey : 'menu.react' , key : '/tech/frontend/react' , icon : < CodeOutlined /> } ,
7171 {
7272 label : 'Vue' ,
73+ i18nKey : 'menu.vue' ,
7374 key : '/tech/frontend/vue' ,
7475 icon : < CodeOutlined /> ,
7576 children : [
7677 {
7778 label : 'Vue 插件' ,
79+ i18nKey : 'menu.vuePlugins' ,
7880 key : '/tech/frontend/plugins' ,
7981 icon : < AppstoreOutlined /> ,
8082 children : [
81- { label : 'Vue3 API' , key : '/tech/frontend/plugins/vue3' , icon : < FileTextOutlined /> } ,
82- { label : '性能优化' , key : '/tech/frontend/plugins/perf' , icon : < ThunderboltOutlined /> } ,
83+ {
84+ label : 'Vue3 API' ,
85+ i18nKey : 'menu.vue3Api' ,
86+ key : '/tech/frontend/plugins/vue3' ,
87+ icon : < FileTextOutlined /> ,
88+ } ,
89+ {
90+ label : '性能优化' ,
91+ i18nKey : 'menu.performanceOptimization' ,
92+ key : '/tech/frontend/plugins/perf' ,
93+ icon : < ThunderboltOutlined /> ,
94+ } ,
8395 ] ,
8496 } ,
8597 ] ,
8698 } ,
87- { label : 'Angular' , key : '/tech/frontend/angular' , icon : < Html5Outlined /> } ,
88- { label : 'Node' , key : '/tech/frontend/node' , icon : < CloudServerOutlined /> } ,
99+ { label : 'Angular' , i18nKey : 'menu.angular' , key : '/tech/frontend/angular' , icon : < Html5Outlined /> } ,
100+ { label : 'Node' , i18nKey : 'menu.node' , key : '/tech/frontend/node' , icon : < CloudServerOutlined /> } ,
89101 ] ,
90102 } ,
91103 {
92104 label : '后端技术栈' ,
105+ i18nKey : 'menu.backendTechStack' ,
93106 key : '/tech/backend' ,
94107 icon : < CloudServerOutlined /> ,
95108 children : [
96- { label : 'Node' , key : '/tech/backend/node' , icon : < CodeOutlined /> } ,
97- { label : 'Java' , key : '/tech/backend/java' , icon : < CodeOutlined /> } ,
98- { label : 'Go' , key : '/tech/backend/go' , icon : < CodeOutlined /> } ,
109+ { label : 'Node' , i18nKey : 'menu.node' , key : '/tech/backend/node' , icon : < CodeOutlined /> } ,
110+ { label : 'Java' , i18nKey : 'menu.java' , key : '/tech/backend/java' , icon : < CodeOutlined /> } ,
111+ { label : 'Go' , i18nKey : 'menu.go' , key : '/tech/backend/go' , icon : < CodeOutlined /> } ,
99112 ] ,
100113 } ,
101114 {
102115 label : '构建工具' ,
116+ i18nKey : 'menu.buildTools' ,
103117 key : '/build' ,
104118 icon : < ApartmentOutlined /> ,
105119 children : [
106- { label : 'Webpack' , key : '/build/webpack' , icon : < ToolOutlined /> } ,
107- { label : 'Vite' , key : '/build/vite' , icon : < ThunderboltOutlined /> } ,
120+ { label : 'Webpack' , i18nKey : 'menu.webpack' , key : '/build/webpack' , icon : < ToolOutlined /> } ,
121+ { label : 'Vite' , i18nKey : 'menu.vite' , key : '/build/vite' , icon : < ThunderboltOutlined /> } ,
108122 ] ,
109123 } ,
110124
111125 {
112126 label : 'Error' ,
127+ i18nKey : 'menu.error' ,
113128 key : '/sub-error' ,
114129 icon : < QuestionCircleOutlined /> ,
115- children : [ { label : 'ErrorBoundary' , key : '/error' } ] ,
130+ children : [ { label : 'ErrorBoundary' , i18nKey : 'menu.errorBoundary' , key : '/error' } ] ,
116131 } ,
117132]
118133
0 commit comments