tabs优化

This commit is contained in:
gary.fu
2023-12-29 17:22:14 +08:00
parent 7e6d0d2d1e
commit 773923d761
8 changed files with 76 additions and 16 deletions

View File

@@ -12,14 +12,17 @@ const calcWithIf = menuItem => {
export const MENU_INFO_LIST = ref({})
export const useMenuInfo = path => {
const menuInfo = MENU_INFO_LIST.value[path]
console.info('================', MENU_INFO_LIST.value)
return menuInfo
export const useMenuInfo = item => {
const path = item.path
if (path !== '/') {
const menuInfo = MENU_INFO_LIST.value[path]
console.info('config menu:', menuInfo)
return menuInfo
}
}
export const useMenuName = item => {
const menuInfo = useMenuInfo(item.path)
const menuInfo = useMenuInfo(item)
if (menuInfo) {
if (menuInfo.label) {
return menuInfo.label