Files
blog-admin-ui/src/layout/components/SideBar/Logo.vue
2025-09-21 22:48:33 +08:00

40 lines
933 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div :class="{'collapse':collapse}">
<!-- 跳转到首页 -->
<transition name="sidebarLogoFade">
<!-- 根据collapse控制Logo组件即是否显示标题 -->
<router-link v-if="collapse" key="collapse" class="logo" to="/dashboard">
<!-- <img :src="logoInfo.logo" alt="logo">-->
</router-link>
<router-link v-else key="expand" class="logo" to="/dashboard">
<img :src="getAssetsImageFile('logo/logo.png')"
alt="logo">
</router-link>
</transition>
</div>
</template>
<script setup lang="ts">
import { defineProps } from 'vue'
import { getAssetsImageFile } from '@/utils'
defineProps({
collapse: {
type: Boolean,
require: true
}
})
</script>
<style lang="scss" scoped>
// 动画样式
.sidebarLogoFade-enter-active {
transition: opacity 1.5s;
}
.sidebarLogoFade-enter,
.sidebarLogoFade-leave-to {
opacity: 0;
}
</style>