吴雨瞳添加了注释

master
wyt 4 months ago
parent 431e2f1134
commit 320bb667d9

@ -1,43 +1,65 @@
<template>
<!-- Logo组件容器点击触发页面跳转包含Logo图片和网站名称 -->
<div class="flex items-start self-stretch relative" @click="handleClick">
<!-- 网站名称区域包含主名称和英文名称点击触发跳转 -->
<div class="flex flex-col relative py-4 z-10 text-white font-medium ob-drop-shadow cursor-pointer" @click="">
<!-- 网站主名称从配置中获取若未加载完成显示LOADING动画 -->
<span class="flex text-3xl" v-if="websiteConfig.name">
{{ websiteConfig.name }}
</span>
<span v-else class="flex text-3xl animation-text">LOADING</span>
<!-- 网站英文名称默认显示BLOG -->
<span class="font-extrabold text-xs uppercase">
{{ websiteConfig.englishName || 'BLOG' }}
</span>
</div>
<!-- 网站Logo图片 -->
<img class="logo-image" :src="websiteConfig.logo" alt="site-logo" />
</div>
</template>
<script lang="ts">
//
import { useAppStore } from '@/stores/app'
// Vue
import { computed } from '@vue/reactivity'
// Vue
import { defineComponent } from 'vue'
//
import { useRouter } from 'vue-router'
//
import { useCommonStore } from '@/stores/common'
//
import { useNavigatorStore } from '@/stores/navigator'
// Logo
export default defineComponent({
name: 'Logo',
setup() {
//
const appStore = useAppStore()
//
const commonStore = useCommonStore()
//
const navigatorStore = useNavigatorStore()
//
const router = useRouter()
// Logo
const handleClick = () => {
router.push({ path: '/' })
if (commonStore.isMobile && navigatorStore.openMenu === true) {
navigatorStore.toggleMobileMenu()
}
}
//
return {
//
websiteConfig: computed(() => {
return appStore.websiteConfig
}),
//
handleClick
}
}
@ -45,6 +67,7 @@ export default defineComponent({
</script>
<style lang="scss" scoped>
// Logo
.logo-image {
height: 200px;
width: 200px;
@ -52,6 +75,6 @@ export default defineComponent({
top: -60px;
left: -60px;
opacity: 0.05;
@apply absolute mr-2 rounded-full;
@apply absolute mr-2 rounded-full; // 使Tailwind2
}
</style>
</style>
Loading…
Cancel
Save