feat: 添加图标库,更新菜单与页面标签中的icon相关功能与样式
This commit is contained in:
@@ -64,6 +64,10 @@
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.tabIcon {
|
||||
color: @primary;
|
||||
}
|
||||
|
||||
.tabBg {
|
||||
&.tabBgActive {
|
||||
.tabBgInner {
|
||||
@@ -127,7 +131,7 @@
|
||||
transition: fill 0.15s;
|
||||
}
|
||||
|
||||
// 仅包裹文字 + 关闭按钮,通过 margin 收在 tab 内部
|
||||
// 仅包裹图标 + 文字 + 关闭按钮,通过 margin 收在 tab 内部
|
||||
.tabContent {
|
||||
position: relative;
|
||||
height: 28px;
|
||||
@@ -143,6 +147,14 @@
|
||||
transition: background-color 0.35s;
|
||||
}
|
||||
|
||||
.tabIcon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.tabTitle {
|
||||
min-width: 0;
|
||||
font-size: 13px;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { defineComponent, type PropType } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import type { TabView } from '@/types';
|
||||
import { renderRouteIcon } from '@/utils/routeIcon';
|
||||
import styles from './PageTabs.module.less';
|
||||
|
||||
/**
|
||||
@@ -71,8 +72,11 @@ const PageTabs = defineComponent({
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
{/* 标签内容:hover 背景包裹文字 + 关闭按钮 */}
|
||||
{/* 标签内容:图标 + 文字 + 关闭按钮 */}
|
||||
<div class={styles.tabContent}>
|
||||
{tab.icon ? (
|
||||
<span class={styles.tabIcon}>{renderRouteIcon(tab.icon, { size: 14 })}</span>
|
||||
) : null}
|
||||
<div class={styles.tabTitle}>{tab.title}</div>
|
||||
<div class={styles.tabClose} onClick={(e: Event) => handleClose(tab.path, e)}>
|
||||
✕
|
||||
|
||||
Reference in New Issue
Block a user