summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpany <[email protected]>2023-07-18 13:36:22 +0800
committerpany <[email protected]>2023-07-18 13:36:22 +0800
commit310ab846facb80e288f8f3383af5fc91bfd6613c (patch)
tree8c7885e9c3d43b9162d76fdf79c2f0ae6aea0c96
parent8a0b8c5b3a3405b84f327a04138f8c6eb70d11f3 (diff)
fix: 修复顶部模式时 Logo 组件动态高度失效
-rw-r--r--src/layouts/components/Logo/index.vue17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/layouts/components/Logo/index.vue b/src/layouts/components/Logo/index.vue
index 06e158e..c420c75 100644
--- a/src/layouts/components/Logo/index.vue
+++ b/src/layouts/components/Logo/index.vue
@@ -23,16 +23,10 @@ const bgCloor = computed(() => {
? getCssVariableValue("--v3-header-bg-color")
: getCssVariableValue("--v3-sidebar-menu-bg-color")
})
-
-const logoHeight = computed(() => {
- return layoutMode.value !== "top"
- ? getCssVariableValue("--v3-header-height")
- : getCssVariableValue("--v3-navigationbar-height")
-})
</script>
<template>
- <div class="layout-logo-container" :class="{ collapse: props.collapse }">
+ <div class="layout-logo-container" :class="{ collapse: props.collapse, 'layout-mode-top': layoutMode === 'top' }">
<transition name="layout-logo-fade">
<router-link v-if="props.collapse" key="collapse" to="/">
<img :src="logo" class="layout-logo" />
@@ -48,8 +42,8 @@ const logoHeight = computed(() => {
.layout-logo-container {
position: relative;
width: 100%;
- height: v-bind(logoHeight);
- line-height: v-bind(logoHeight);
+ height: var(--v3-header-height);
+ line-height: var(--v3-header-height);
background-color: v-bind(bgCloor);
text-align: center;
overflow: hidden;
@@ -62,6 +56,11 @@ const logoHeight = computed(() => {
}
}
+.layout-mode-top {
+ height: var(--v3-navigationbar-height);
+ line-height: var(--v3-navigationbar-height);
+}
+
.collapse {
.layout-logo {
width: 32px;