feat: 修改 logo

This commit is contained in:
zhengkunwang223 2023-02-17 11:27:19 +08:00 committed by zhengkunwang223
parent e3976aa359
commit 819ce10db0
6 changed files with 15 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View file

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View file

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -1,12 +1,24 @@
<template>
<div class="logo flx-center">
<img v-show="!isCollapse" src="@/assets/images/1panel-menu.png" />
<img v-show="isCollapse" src="@/assets/images/1panel-small.png" />
<img v-show="!isCollapse" :src="getLogoUrl(isCollapse)" alt="" />
<img v-show="isCollapse" :src="getLogoUrl(isCollapse)" alt="" />
</div>
</template>
<script setup lang="ts">
import { GlobalStore } from '@/store';
defineProps<{ isCollapse: boolean }>();
const globalStore = GlobalStore();
const getLogoUrl = (isCollapse: boolean) => {
const theme = globalStore.$state.themeConfig.theme || 'light';
if (isCollapse) {
return new URL(`../../../../assets/images/1panel-logo-${theme}.png`, import.meta.url).href;
} else {
return new URL(`../../../../assets/images/1panel-menu-${theme}.png`, import.meta.url).href;
}
};
</script>
<style scoped lang="scss">

View file

@ -2,5 +2,4 @@
@use './element.scss';
@use './element-dark.scss';
@use './reset.scss';
@use './var.scss';