vue-vben-admin icon indicating copy to clipboard operation
vue-vben-admin copied to clipboard

最新的仓库解决ROLE问题后 ROLE模式下路由菜单取name做菜单名而不取title了

Open 672064406zerui opened this issue 5 months ago • 4 comments

⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.

  • [x] Read the docs.
  • [x] Make sure the code is up to date. (Some bugs have been fixed in the latest code)
  • [x] This is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.

Describe the bug

A clear and concise description of what the bug is..

最新的仓库解决ROLE问题后 ROLE模式下路由菜单取name做菜单名而不取title了

mapping模式 没问题

Reproduction

Please describe the steps of the problem in detail to ensure that we can restore the correct problem

System Info

  • Operating System:2.10.1
  • Node version:18.12
  • Package manager (npm/yarn/pnpm) and version:

672064406zerui avatar Mar 08 '24 08:03 672064406zerui

@672064406zerui emmm,我查看了这部分的代码,并不是一个bug,原因是对于menu的title取的是route.name而不是route.meta.title,如果你觉得将route.meta.title作为menu的title更合理些可以提一个PR? 如果你想要解决这个问题的话有三种办法:

  1. 将所有处于src/router/routes/modules下的所有前端路由的name全部改成其对应meta.title中的值
  2. 这里改成const getI18nName = computed(() => t(props.item?.meta?.title || props.item?.name));
  3. 用以上方式提一个PR 1 2 3

cszhjh avatar Mar 08 '24 13:03 cszhjh

我是觉得 这块其实就应该取title吧。如果是name的话 那路由缓存怎么办呢 name 就应该是一个固定的值啊

672064406zerui avatar Mar 11 '24 00:03 672064406zerui

我是觉得 这块其实就应该取title吧。如果是name的话 那路由缓存怎么办呢 name 就应该是一个固定的值啊

确实会存在唯一性的问题,而二级菜单是有可能同名的,提一个吧

cszhjh avatar Mar 11 '24 01:03 cszhjh

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

anncwb avatar May 10 '24 02:05 anncwb