feat(Logo): Add Logo component
parent
41281c4d54
commit
958edefe7b
@ -0,0 +1,3 @@
|
|||||||
|
import Backtop from './src/Backtop.vue'
|
||||||
|
|
||||||
|
export { Backtop }
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ElBacktop } from 'element-plus'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ElBacktop target=".v-content .el-scrollbar__wrap" />
|
||||||
|
</template>
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
import Logo from './src/Logo.vue'
|
||||||
|
|
||||||
|
export { Logo }
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, watch, computed } from 'vue'
|
||||||
|
import { useAppStore } from '@/store/modules/app'
|
||||||
|
|
||||||
|
const appStore = useAppStore()
|
||||||
|
|
||||||
|
const show = ref(true)
|
||||||
|
|
||||||
|
const title = computed(() => appStore.getLogoTitle)
|
||||||
|
|
||||||
|
const layout = computed(() => appStore.getLayout)
|
||||||
|
|
||||||
|
const collapse = computed(() => appStore.getCollapse)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => collapse.value,
|
||||||
|
(collapse: boolean) => {
|
||||||
|
if (layout.value !== 'classic') {
|
||||||
|
show.value = true
|
||||||
|
} else {
|
||||||
|
if (!collapse) {
|
||||||
|
setTimeout(() => {
|
||||||
|
show.value = !collapse
|
||||||
|
}, 400)
|
||||||
|
} else {
|
||||||
|
show.value = !collapse
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<router-link
|
||||||
|
:class="[
|
||||||
|
'v-logo',
|
||||||
|
{
|
||||||
|
'v-logo__Top': layout !== 'classic'
|
||||||
|
},
|
||||||
|
'flex h-[var(--logo-height)] items-center cursor-pointer pl-8px'
|
||||||
|
]"
|
||||||
|
to="/"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src="@/assets/imgs/logo.png"
|
||||||
|
class="w-[calc(var(--logo-height)-10px)] h-[calc(var(--logo-height)-10px)]"
|
||||||
|
/>
|
||||||
|
<div v-if="show" class="text-[var(--logo-title-text-color)] ml-10px text-16px font-700">{{
|
||||||
|
title
|
||||||
|
}}</div>
|
||||||
|
</router-link>
|
||||||
|
</template>
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
import Setting from './src/Setting.vue'
|
||||||
|
|
||||||
|
export { Setting }
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ElDrawer } from 'element-plus'
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
const drawer = ref(false)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="v-setting fixed top-[45%] right-0 w-40px h-40px text-center leading-40px bg-[var(--el-color-primary)] cursor-pointer"
|
||||||
|
@click="drawer = true"
|
||||||
|
>
|
||||||
|
<Icon icon="ant-design:setting-outlined" color="#fff" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ElDrawer v-model="drawer" :with-header="false" direction="rtl" size="300px">ddd</ElDrawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
@prefix-cls: ~'@{namespace}-setting';
|
||||||
|
|
||||||
|
.@{prefix-cls} {
|
||||||
|
border-radius: 6px 0 0 6px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue