mirror of
https://gitee.com/JavaLionLi/plus-ui.git
synced 2026-09-13 07:43:43 +08:00
fix 修复 icon #号默认值与空值不在一列展示
This commit is contained in:
parent
33fb49d683
commit
8a3ff74833
@ -75,7 +75,7 @@
|
||||
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="220">
|
||||
<template #default="scope">
|
||||
<div class="menu-name-cell">
|
||||
<svg-icon v-if="scope.row.icon" :icon-class="scope.row.icon" />
|
||||
<svg-icon v-if="isMenuIconVisible(scope.row.icon)" :icon-class="scope.row.icon" />
|
||||
<span class="menu-name-text">{{ scope.row.menuName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
@ -431,6 +431,11 @@ const { dialog, openDialog, closeDialog, setTitle } = useDialogState();
|
||||
|
||||
type MenuTagType = 'warning' | 'primary' | 'success' | 'danger';
|
||||
|
||||
const isMenuIconVisible = (icon?: string) => {
|
||||
const normalizedIcon = icon?.trim();
|
||||
return !!normalizedIcon && normalizedIcon !== '#';
|
||||
};
|
||||
|
||||
const getMenuTypeMeta = (menu: Partial<MenuVO>): { label: string; type: MenuTagType } => {
|
||||
if (menu.menuType === MenuTypeEnum.F) {
|
||||
return { label: '按钮', type: 'warning' };
|
||||
|
||||
Loading…
Reference in New Issue
Block a user