fix: #432
This commit is contained in:
parent
6bcb89eb4e
commit
df5b7166b4
|
@ -245,6 +245,16 @@ const move = (to: number) => {
|
||||||
start()
|
start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const canShowIcon = (item: RouteLocationNormalizedLoaded) => {
|
||||||
|
if (
|
||||||
|
(item?.matched?.[1]?.meta?.icon && unref(tagsViewIcon)) ||
|
||||||
|
(item?.meta?.affix && unref(tagsViewIcon) && item?.meta?.icon)
|
||||||
|
) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initTags()
|
initTags()
|
||||||
addTags()
|
addTags()
|
||||||
|
@ -357,13 +367,8 @@ watch(
|
||||||
class="h-full flex justify-center items-center whitespace-nowrap pl-15px"
|
class="h-full flex justify-center items-center whitespace-nowrap pl-15px"
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
v-if="
|
v-if="canShowIcon(item)"
|
||||||
item?.matched &&
|
:icon="item?.matched?.[1]?.meta?.icon || item?.meta?.icon"
|
||||||
item?.matched[1] &&
|
|
||||||
item?.matched[1]?.meta?.icon &&
|
|
||||||
tagsViewIcon
|
|
||||||
"
|
|
||||||
:icon="item?.matched[1]?.meta?.icon"
|
|
||||||
:size="12"
|
:size="12"
|
||||||
class="mr-5px"
|
class="mr-5px"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -46,6 +46,7 @@ export const usePermissionStore = defineStore('permission', {
|
||||||
if (type === 'server') {
|
if (type === 'server') {
|
||||||
// 模拟后端过滤菜单
|
// 模拟后端过滤菜单
|
||||||
routerMap = generateRoutesByServer(routers as AppCustomRouteRecordRaw[])
|
routerMap = generateRoutesByServer(routers as AppCustomRouteRecordRaw[])
|
||||||
|
console.log(routerMap)
|
||||||
} else if (type === 'frontEnd') {
|
} else if (type === 'frontEnd') {
|
||||||
// 模拟前端过滤菜单
|
// 模拟前端过滤菜单
|
||||||
routerMap = generateRoutesByFrontEnd(cloneDeep(asyncRouterMap), routers as string[])
|
routerMap = generateRoutesByFrontEnd(cloneDeep(asyncRouterMap), routers as string[])
|
||||||
|
|
Loading…
Reference in New Issue