refactor: ♻️ css 命名优化
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="logo-container">
|
<div class="logo">
|
||||||
<transition enter-active-class="animate__animated animate__fadeInLeft">
|
<transition enter-active-class="animate__animated animate__fadeInLeft">
|
||||||
<router-link :key="+collapse" class="wh-full flex-center" to="/">
|
<router-link :key="+collapse" class="wh-full flex-center" to="/">
|
||||||
<img :src="logo" class="logo-image" />
|
<img :src="logo" class="w20px h20px" />
|
||||||
<span v-if="!collapse" class="logo-title">
|
<span v-if="!collapse" class="title">
|
||||||
{{ defaultSettings.title }}
|
{{ defaultSettings.title }}
|
||||||
</span>
|
</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import logo from "@/assets/logo.png";
|
|
||||||
import defaultSettings from "@/settings";
|
import defaultSettings from "@/settings";
|
||||||
|
import logo from "@/assets/logo.png";
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
collapse: {
|
collapse: {
|
||||||
@@ -24,17 +24,12 @@ defineProps({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.logo-container {
|
.logo {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: $navbar-height;
|
height: $navbar-height;
|
||||||
background-color: $sidebar-logo-background;
|
background-color: $sidebar-logo-background;
|
||||||
|
|
||||||
.logo-image {
|
.title {
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo-title {
|
|
||||||
flex-shrink: 0; /* 防止容器在空间不足时缩小 */
|
flex-shrink: 0; /* 防止容器在空间不足时缩小 */
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -45,12 +40,12 @@ defineProps({
|
|||||||
|
|
||||||
.layout-top,
|
.layout-top,
|
||||||
.layout-mix {
|
.layout-mix {
|
||||||
.logo-container {
|
.logo {
|
||||||
width: $sidebar-width;
|
width: $sidebar-width;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.hideSidebar {
|
&.hideSidebar {
|
||||||
.logo-container {
|
.logo {
|
||||||
width: $sidebar-width-collapsed;
|
width: $sidebar-width-collapsed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user