Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [BUG] npm run i18n-remove移除国际化,左侧导航栏消失 #10602

Closed
dwyanedeng123 opened this issue Mar 10, 2023 · 3 comments
Closed
Labels

Comments

@dwyanedeng123
Copy link

dwyanedeng123 commented Mar 10, 2023

🐛 bug 描述

运行npm run i18n-remove报错
把eslint和prettier装上之后,把es2022: true注释掉
能够成功运行npm run i18n-remove
但是运行后左侧菜单栏消失

📷 复现步骤 | Recurrence steps

image

🏞 期望结果 | Expected results

能正常移除i18-n国际化组件

💻 复现代码 | Recurrence code

© 版本信息

  • Ant Design Pro 版本: [e.g. 4.0.0]
  • umi 版本
  • 浏览器环境
  • 开发环境 [e.g. mac OS]

🚑 其他信息

@dm-ytlds
Copy link

同问

@dm-ytlds
Copy link

将 config 模块的 route.js 配置文件的每一条路由都加上对应的 name 属性,如下:

export default [
  { name: '登录', path: '/user', layout: false, routes: [{ path: '/user/login', component: './User/Login' }] },
  { name: '欢迎页面', path: '/welcome', icon: 'smile', component: './Welcome' },
  {
    path: '/admin',
    icon: 'crown',
    access: 'canAdmin',
    name: '管理员页面',
    routes: [
      { path: '/admin', redirect: '/admin/sub-page' },
      { path: '/admin/sub-page', component: './Admin' },
    ],
  },
  { icon: 'table', path: '/list', component: './TableList', name: '表格页' },
  { path: '/', redirect: '/welcome' },
  { path: '*', layout: false, component: './404' },
];

@chenshuai2144
Copy link
Collaborator

TAutomatically replying with ChatGPT can be attempted, but it cannot be guaranteed to be completely accurate and may not fully address all issues. Please feel free to reply if you have any further questions or concerns.
此回复基于 ChatGPT 自动生成,可以尝试下方案,官方人员会在一定时间后继续继续处理。

问题已解决,该方法是正确的。添加 name 属性后将在菜单上展示对应路由的名称,如果没有添加该属性,则菜单默认展示 path 属性。左侧导航栏消失可能是其他原因导致的,可以检查代码或者提供更多的信息以便进一步解决问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants