|
@@ -5,28 +5,24 @@
|
|
|
<a :href="mainURL"><img :src="logoPng" /></a>
|
|
|
</h2>
|
|
|
<div class="right_menu_container">
|
|
|
- <a-dropdown placement="bottomRight">
|
|
|
+ <a-dropdown placement="bottomRight" trigger="click">
|
|
|
<template #overlay>
|
|
|
<a-menu style="width: 100px" @click="handlerLangClick">
|
|
|
<a-menu-item
|
|
|
v-for="menu in langList"
|
|
|
:key="menu.key"
|
|
|
- class="menu-item"
|
|
|
+ class="menu-item lang-item"
|
|
|
:class="{ [menu.key]: true }"
|
|
|
>
|
|
|
+ <img style="height: 10px" :src="menu.icon" />
|
|
|
{{ menu.label }}
|
|
|
</a-menu-item>
|
|
|
</a-menu>
|
|
|
</template>
|
|
|
- <div class="avatar">
|
|
|
- <a-avatar :size="32">
|
|
|
- <template #icon>
|
|
|
- <img :src="userStore.current.avatar" />
|
|
|
- </template>
|
|
|
- </a-avatar>
|
|
|
+ <div class="avatar" style="margin-right: 30px">
|
|
|
+ <img style="height: 14px" :src="getImgSrc(currentLang.key)" />
|
|
|
<span>
|
|
|
{{ currentLang.label }}
|
|
|
- <!-- <DownOutlined /> -->
|
|
|
</span>
|
|
|
</div>
|
|
|
</a-dropdown>
|
|
@@ -70,11 +66,11 @@ import logoPng from '@/assets/images/logo.png'
|
|
|
import { useLocaleStore } from '@/store/modules/locale'
|
|
|
import { useI18n } from '@/hook/useI18n'
|
|
|
import { useLocale } from '@/locales/useLocale'
|
|
|
-import { computed, unref, inject } from 'vue'
|
|
|
+import { computed, unref } from 'vue'
|
|
|
import { LocaleType } from '#/config'
|
|
|
import { showLoading } from '@/components/loading'
|
|
|
-
|
|
|
-const getImgSrc = inject('getImgSrc')
|
|
|
+import { getImgSrc } from '@/utils/getImgSrc'
|
|
|
+// const getImgSrc = inject('getImgSrc')
|
|
|
|
|
|
defineOptions({ name: 'LayoutHeader' })
|
|
|
|
|
@@ -91,12 +87,12 @@ const currentLang = computed(() => {
|
|
|
label: t(`base.lang.${unref(getLocale)}`)
|
|
|
}
|
|
|
})
|
|
|
-console.log('getImgSrc', getImgSrc)
|
|
|
+// console.log('getImgSrc', getImgSrc)
|
|
|
const langList = localInfo.availableLocales.map((item: string) => {
|
|
|
return {
|
|
|
key: item,
|
|
|
label: t(`base.lang.${item}`),
|
|
|
- // icon: getImgSrc(unref(getLocale))
|
|
|
+ icon: getImgSrc(item)
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -133,6 +129,10 @@ const handlerLangClick: MenuProps['onClick'] = async e => {
|
|
|
color: #fa7c7c;
|
|
|
}
|
|
|
}
|
|
|
+.lang-item {
|
|
|
+ text-align: left;
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss" scoped>
|