mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-21 14:41:29 +00:00
refactor:前台菜单的路由路径支持 query
This commit is contained in:
parent
b75e44f9ff
commit
3db75e0ff2
@ -38,7 +38,7 @@
|
||||
:key="index"
|
||||
@click="routerPush('', menu)"
|
||||
class="user-menu-item"
|
||||
:class="route.name == menu.name ? 'active' : ''"
|
||||
:class="route.fullPath == menu.path ? 'active' : ''"
|
||||
>
|
||||
<Icon :name="menu.meta?.icon" size="16" color="var(--el-text-color-secondary)" />
|
||||
<span>{{ menu.meta?.title }}</span>
|
||||
|
@ -165,7 +165,7 @@ const isExternalLink = (menus: RouteRecordRaw[], index: string): boolean => {
|
||||
const searchMenuIndex = (menus: RouteRecordRaw[], route: RouteLocationNormalizedLoaded): number | false => {
|
||||
let find: boolean | number = false
|
||||
for (const key in menus) {
|
||||
if (menus[key].meta?.id && (menus[key].path == route.fullPath || menus[key].name == route.name)) {
|
||||
if (menus[key].meta?.id && menus[key].path == route.fullPath) {
|
||||
return menus[key].meta.id as number
|
||||
}
|
||||
if (menus[key].children && menus[key].children?.length) {
|
||||
|
Loading…
Reference in New Issue
Block a user