a
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="layout-logo" v-if="setShowLogo" @click="onThemeConfigChange">
|
||||
<div class="layout-logo" v-if="setShowLogo" @click="onThemeConfigChange" :style="{backgroundColor: setBackgroundColor}">
|
||||
<span :style="{color:setFontColor}">{{ themeConfig.globalTitle }}</span>
|
||||
</div>
|
||||
<div class="layout-logo-size" v-else @click="onThemeConfigChange">
|
||||
@@ -21,10 +21,16 @@ const setShowLogo = computed(() => {
|
||||
return !isCollapse || layout === 'classic' || document.body.clientWidth < 1000;
|
||||
});
|
||||
|
||||
// 设置 title 的显示颜色。根据布局模式自动显示
|
||||
// 设置 title 的显示颜色。使用顶栏配置,与顶部导航栏保持一致
|
||||
const setFontColor = computed(() => {
|
||||
let {layout} = themeConfig.value;
|
||||
return layout === 'classic' || layout === 'transverse' ? `var(--next-bg-topBarColor)` : 'var(--el-color-primary)';
|
||||
// let {layout} = themeConfig.value;
|
||||
// return layout === 'classic' || layout === 'transverse' ? `var(--next-bg-topBarColor)` : 'var(--el-color-primary)';
|
||||
return themeConfig.value.topBarColor;
|
||||
});
|
||||
|
||||
// 设置背景色。使用顶栏配置,与顶部导航栏保持一致
|
||||
const setBackgroundColor = computed(() => {
|
||||
return themeConfig.value.topBar;
|
||||
});
|
||||
|
||||
// logo 点击实现菜单展开/收起
|
||||
@@ -36,27 +42,29 @@ const onThemeConfigChange = () => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.layout-logo {
|
||||
width: 220px;
|
||||
width: 200px;
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: rgb(0 21 41 / 2%) 0px 1px 4px;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
animation: logoAnimation 0.3s ease-in-out;
|
||||
// 背景色通过内联样式动态设置,使用顶栏配置
|
||||
|
||||
span {
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
font-size: 21.5px;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
// 文字颜色通过内联样式动态设置,使用顶栏配置
|
||||
}
|
||||
|
||||
&:hover {
|
||||
span {
|
||||
color: var(--color-primary-light-2);
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user