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

91 lines
2.6 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-07-01 01:45:59 +00:00
<div class="app-title-container cursor" @click="router.push('/')">
<div class="logo flex-center">
2024-07-15 10:08:02 +00:00
<LogoFull />
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="$t('layout.topbar.github')" placement="top">
2024-04-28 04:56:46 +00:00
<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="$t('layout.topbar.wiki')" placement="top">
2024-04-28 04:56:46 +00:00
<AppIcon
iconName="app-reading"
class="cursor color-secondary mr-8 ml-8"
style="font-size: 20px"
2024-07-03 09:30:34 +00:00
@click="toUrl('https://maxkb.cn/docs/')"
2024-04-28 04:56:46 +00:00
></AppIcon>
</el-tooltip>
<el-tooltip effect="dark" :content="$t('layout.topbar.forum')" placement="top">
2024-04-28 04:56:46 +00:00
<AppIcon
iconName="app-help"
class="cursor color-secondary mr-8 ml-8"
style="font-size: 20px"
@click="toUrl('https://bbs.fit2cloud.com/c/mk/11')"
></AppIcon>
</el-tooltip>
<el-dropdown v-if="false" trigger="click" type="primary">
<template #dropdown>
<el-dropdown-menu>
2024-04-28 04:56:46 +00:00
<el-dropdown-item
v-for="(lang, index) in langList"
:key="index"
:value="lang.value"
@click="changeLang(lang.value)"
>{{ lang.label }}</el-dropdown-item
>
</el-dropdown-menu>
</template>
2024-04-28 04:56:46 +00:00
<AppIcon
iconName="app-translate"
class="cursor color-secondary mr-16 ml-8"
style="font-size: 20px"
>
</AppIcon>
</el-dropdown>
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'
2024-04-28 04:56:46 +00:00
import { langList } from '@/locales/index'
import { useLocale } from '@/locales/useLocale'
2024-03-14 10:13:50 +00:00
const router = useRouter()
2024-07-10 10:04:38 +00:00
2024-04-28 04:56:46 +00:00
const { changeLocale } = useLocale()
const changeLang = (lang: string) => {
2024-04-28 04:56:46 +00:00
changeLocale(lang)
}
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
}
2023-10-13 08:11:54 +00:00
.line {
height: 2em;
}
2023-09-15 09:40:35 +00:00
}
</style>