UnisKB/ui/src/layout/components/top-bar/index.vue

77 lines
2.1 KiB
Vue
Raw Normal View History

·
2023-09-15 09:40:35 +00:00
<template>
2023-11-02 10:25:09 +00:00
<div class="top-bar-container border-b flex-between">
2023-10-13 08:11:54 +00:00
<div class="flex-center h-full">
2024-03-14 10:13:50 +00:00
<div class="app-title-container flex-center cursor" @click="router.push('/')">
<div class="app-title-icon"></div>
<div class="app-title-text app-logo-font ml-4">
{{ defaultTitle }}
2023-12-07 11:28:38 +00:00
</div>
2024-03-14 10:13:50 +00:00
</div>
2023-09-15 09:40:35 +00:00
<TopMenu></TopMenu>
</div>
<div class="flex-center avatar">
<el-tooltip effect="dark" content="项目地址" placement="top">
<AppIcon
iconName="app-github"
class="cursor color-secondary mr-8 ml-8"
style="font-size: 20px"
@click="toUrl('https://github.com/1Panel-dev/MaxKB')"
></AppIcon>
</el-tooltip>
<el-tooltip effect="dark" content="用户手册" placement="top">
<AppIcon
iconName="app-reading"
class="cursor color-secondary mr-8 ml-8"
style="font-size: 20px"
@click="toUrl('https://github.com/1Panel-dev/MaxKB/wiki')"
></AppIcon>
</el-tooltip>
<el-tooltip effect="dark" content="论坛求助" placement="top">
<AppIcon
iconName="app-help"
class="cursor color-secondary mr-16 ml-8"
style="font-size: 20px"
@click="toUrl('https://bbs.fit2cloud.com/c/mk/11')"
></AppIcon>
</el-tooltip>
2023-09-15 09:40:35 +00:00
<Avatar></Avatar>
</div>
</div>
</template>
<script setup lang="ts">
2023-10-16 10:58:51 +00:00
import TopMenu from './top-menu/index.vue'
import Avatar from './avatar/index.vue'
2024-03-14 10:13:50 +00:00
import { useRouter } from 'vue-router'
const router = useRouter()
2023-10-12 08:36:16 +00:00
const defaultTitle = import.meta.env.VITE_APP_TITLE
function toUrl(url: string) {
window.open(url, '_blank')
}
2023-09-15 09:40:35 +00:00
</script>
<style lang="scss">
.top-bar-container {
2023-10-13 08:11:54 +00:00
height: var(--app-header-height);
box-sizing: border-box;
padding: var(--app-header-padding);
2023-09-15 09:40:35 +00:00
.app-title-container {
2023-11-02 10:25:09 +00:00
margin-right: 45px;
2023-09-15 09:40:35 +00:00
.app-title-icon {
2023-12-18 06:42:13 +00:00
background-image: url('@/assets/logo.png');
2023-09-15 09:40:35 +00:00
background-size: 100% 100%;
2023-12-18 06:42:13 +00:00
width: 35px;
height: 35px;
2023-09-15 09:40:35 +00:00
}
.app-title-text {
2023-11-02 10:25:09 +00:00
font-size: 24px;
2023-09-15 09:40:35 +00:00
}
}
2023-10-13 08:11:54 +00:00
.line {
height: 2em;
}
2023-09-15 09:40:35 +00:00
}
</style>