mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	perf: modify showLogo type: from string to Boolean
This commit is contained in:
		
							parent
							
								
									34eda14473
								
							
						
					
					
						commit
						e61d6109d7
					
				@ -14,7 +14,7 @@
 | 
				
			|||||||
  "HideTabs": false,
 | 
					  "HideTabs": false,
 | 
				
			||||||
  "SidebarStatus": true,
 | 
					  "SidebarStatus": true,
 | 
				
			||||||
  "EpThemeColor": "#409EFF",
 | 
					  "EpThemeColor": "#409EFF",
 | 
				
			||||||
  "ShowLogo": "1",
 | 
					  "ShowLogo": true,
 | 
				
			||||||
  "ShowModel": "smart",
 | 
					  "ShowModel": "smart",
 | 
				
			||||||
  "MapConfigure": {
 | 
					  "MapConfigure": {
 | 
				
			||||||
    "amapKey": "97b3248d1553172e81f168cf94ea667e",
 | 
					    "amapKey": "97b3248d1553172e81f168cf94ea667e",
 | 
				
			||||||
 | 
				
			|||||||
@ -79,9 +79,9 @@ if (unref(layoutTheme)) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 默认灵动模式
 | 
					// 默认灵动模式
 | 
				
			||||||
const markValue = ref(instance.configure?.showModel || "smart");
 | 
					const markValue = ref(instance.configure?.showModel ?? "smart");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const logoVal = ref(instance.configure?.showLogo || "1");
 | 
					const logoVal = ref(instance.configure?.showLogo ?? true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const epThemeColor = ref(useEpThemeStoreHook().getEpThemeColor);
 | 
					const epThemeColor = ref(useEpThemeStoreHook().getEpThemeColor);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -175,9 +175,9 @@ function onChange(label) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// 侧边栏Logo
 | 
					// 侧边栏Logo
 | 
				
			||||||
function logoChange() {
 | 
					function logoChange() {
 | 
				
			||||||
  unref(logoVal) === "1"
 | 
					  unref(logoVal)
 | 
				
			||||||
    ? changeStorageConfigure("showLogo", "1")
 | 
					    ? changeStorageConfigure("showLogo", true)
 | 
				
			||||||
    : changeStorageConfigure("showLogo", "-1");
 | 
					    : changeStorageConfigure("showLogo", false);
 | 
				
			||||||
  emitter.emit("logoChange", unref(logoVal));
 | 
					  emitter.emit("logoChange", unref(logoVal));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -399,8 +399,8 @@ nextTick(() => {
 | 
				
			|||||||
        <el-switch
 | 
					        <el-switch
 | 
				
			||||||
          v-model="logoVal"
 | 
					          v-model="logoVal"
 | 
				
			||||||
          inline-prompt
 | 
					          inline-prompt
 | 
				
			||||||
          active-value="1"
 | 
					          :active-value="true"
 | 
				
			||||||
          inactive-value="-1"
 | 
					          :inactive-value="false"
 | 
				
			||||||
          inactive-color="#a6a6a6"
 | 
					          inactive-color="#a6a6a6"
 | 
				
			||||||
          active-text="开"
 | 
					          active-text="开"
 | 
				
			||||||
          inactive-text="关"
 | 
					          inactive-text="关"
 | 
				
			||||||
 | 
				
			|||||||
@ -13,7 +13,7 @@ const route = useRoute();
 | 
				
			|||||||
const pureApp = useAppStoreHook();
 | 
					const pureApp = useAppStoreHook();
 | 
				
			||||||
const router = useRouter().options.routes;
 | 
					const router = useRouter().options.routes;
 | 
				
			||||||
const showLogo = ref(
 | 
					const showLogo = ref(
 | 
				
			||||||
  storageLocal.getItem("responsive-configure")?.showLogo || "1"
 | 
					  storageLocal.getItem("responsive-configure")?.showLogo ?? true
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
const isCollapse = computed(() => {
 | 
					const isCollapse = computed(() => {
 | 
				
			||||||
  return !pureApp.getSidebarStatus;
 | 
					  return !pureApp.getSidebarStatus;
 | 
				
			||||||
@ -60,7 +60,7 @@ onBeforeMount(() => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <div :class="['sidebar-container', showLogo ? 'has-logo' : '']">
 | 
					  <div :class="['sidebar-container', showLogo ? 'has-logo' : '']">
 | 
				
			||||||
    <Logo v-if="showLogo === '1'" :collapse="isCollapse" />
 | 
					    <Logo v-if="showLogo" :collapse="isCollapse" />
 | 
				
			||||||
    <el-scrollbar wrap-class="scrollbar-wrapper">
 | 
					    <el-scrollbar wrap-class="scrollbar-wrapper">
 | 
				
			||||||
      <el-menu
 | 
					      <el-menu
 | 
				
			||||||
        :default-active="activeMenu"
 | 
					        :default-active="activeMenu"
 | 
				
			||||||
 | 
				
			|||||||
@ -64,7 +64,7 @@ const layout = computed(() => {
 | 
				
			|||||||
      grey: instance.$config?.Grey ?? false,
 | 
					      grey: instance.$config?.Grey ?? false,
 | 
				
			||||||
      weak: instance.$config?.Weak ?? false,
 | 
					      weak: instance.$config?.Weak ?? false,
 | 
				
			||||||
      hideTabs: instance.$config?.HideTabs ?? false,
 | 
					      hideTabs: instance.$config?.HideTabs ?? false,
 | 
				
			||||||
      showLogo: instance.$config?.ShowLogo ?? "1",
 | 
					      showLogo: instance.$config?.ShowLogo ?? true,
 | 
				
			||||||
      showModel: instance.$config?.ShowModel ?? "smart",
 | 
					      showModel: instance.$config?.ShowModel ?? "smart",
 | 
				
			||||||
      multiTagsCache: instance.$config?.MultiTagsCache ?? false
 | 
					      multiTagsCache: instance.$config?.MultiTagsCache ?? false
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
				
			|||||||
@ -29,7 +29,7 @@ export const injectResponsiveStorage = (app: App, config: ServerConfigs) => {
 | 
				
			|||||||
          grey: config.Grey ?? false,
 | 
					          grey: config.Grey ?? false,
 | 
				
			||||||
          weak: config.Weak ?? false,
 | 
					          weak: config.Weak ?? false,
 | 
				
			||||||
          hideTabs: config.HideTabs ?? false,
 | 
					          hideTabs: config.HideTabs ?? false,
 | 
				
			||||||
          showLogo: config.ShowLogo ?? "1",
 | 
					          showLogo: config.ShowLogo ?? true,
 | 
				
			||||||
          showModel: config.ShowModel ?? "smart",
 | 
					          showModel: config.ShowModel ?? "smart",
 | 
				
			||||||
          multiTagsCache: config.MultiTagsCache ?? false
 | 
					          multiTagsCache: config.MultiTagsCache ?? false
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								types/global.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								types/global.d.ts
									
									
									
									
										vendored
									
									
								
							@ -88,7 +88,7 @@ declare global {
 | 
				
			|||||||
    HideTabs?: boolean;
 | 
					    HideTabs?: boolean;
 | 
				
			||||||
    SidebarStatus?: boolean;
 | 
					    SidebarStatus?: boolean;
 | 
				
			||||||
    EpThemeColor?: string;
 | 
					    EpThemeColor?: string;
 | 
				
			||||||
    ShowLogo?: string;
 | 
					    ShowLogo?: boolean;
 | 
				
			||||||
    ShowModel?: string;
 | 
					    ShowModel?: string;
 | 
				
			||||||
    MapConfigure?: {
 | 
					    MapConfigure?: {
 | 
				
			||||||
      amapKey?: string;
 | 
					      amapKey?: string;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user