Skip to content

Commit 60bafa0

Browse files
committed
fix(SideMenu): 修复菜单文本与图标居中
1 parent abaf24d commit 60bafa0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/layouts/BasicLayout/components/SideMenu.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export default defineComponent({
4343
router.push(e.key);
4444
};
4545

46-
const getIcon = (type?: string) => (type ? <Icon type={type} /> : null);
46+
const getIcon = (type?: string) =>
47+
type ? <Icon type={type} className="sideMenu-icon" /> : null;
4748

4849
// 构建树结构
4950
const makeTreeDom = (data: MenuDataItem[]): JSX.Element[] => {

src/layouts/BasicLayout/components/index.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@
2424
color: #3860f4;
2525
}
2626
}
27+
.sideMenu-icon {
28+
vertical-align: 1px;
29+
}
2730
}

0 commit comments

Comments
 (0)