feat: 优化菜单名称右侧的额外图标,使其支持更多图标渲染模式

This commit is contained in:
xiaoxian521
2023-02-09 20:04:57 +08:00
parent e323411d1c
commit b455b2da89
8 changed files with 95 additions and 70 deletions

View File

@@ -1,4 +1,3 @@
import { computed } from "vue";
import { storeToRefs } from "pinia";
import { getConfig } from "@/config";
import { useRouter } from "vue-router";
@@ -7,6 +6,7 @@ import { routeMetaType } from "../types";
import { useGlobal } from "@pureadmin/utils";
import { transformI18n } from "@/plugins/i18n";
import { router, remainingPaths } from "@/router";
import { computed, type CSSProperties } from "vue";
import { useAppStoreHook } from "@/store/modules/app";
import { useUserStoreHook } from "@/store/modules/user";
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
@@ -21,6 +21,16 @@ export function useNav() {
/** 平台`layout`中所有`el-tooltip`的`effect`配置,默认`light` */
const tooltipEffect = getConfig()?.TooltipEffect ?? "light";
const getDivStyle = computed((): CSSProperties => {
return {
width: "100%",
display: "flex",
alignItems: "center",
justifyContent: "space-between",
overflow: "hidden"
};
});
/** 用户名 */
const username = computed(() => {
return useUserStoreHook()?.username;
@@ -146,6 +156,7 @@ export function useNav() {
$storage,
backHome,
onPanel,
getDivStyle,
changeTitle,
toggleSideBar,
menuSelect,