refactor: 优化顶部空间,切换语言控件修改

This commit is contained in:
Captain.B 2021-06-26 11:34:55 +08:00 committed by 刘瑞斌
parent f562d3eb25
commit 664b22055e
1 changed files with 19 additions and 14 deletions

View File

@ -1,18 +1,16 @@
<template> <template>
<el-menu :unique-opened="true" class="header-user-menu align-right" <el-dropdown size="medium" @command="changeLanguage" class="align-right">
mode="horizontal" <span class="dropdown-link">
:background-color="color" <font-awesome-icon :icon="['fas', 'language']" size="lg"/>
text-color="#fff" </span>
active-text-color="#fff"> <template v-slot:dropdown>
<el-submenu index="1"> <el-dropdown-menu>
<template slot="title"> <el-dropdown-item :command="key" v-for="(value, key) in languageMap" :key="key">
<span>{{ language }}</span>
</template>
<el-menu-item v-for="(value, key) in languageMap" :key="key" @click="changeLanguage(key)">
{{ value }} <i class="el-icon-check" v-if="language === value"/> {{ value }} <i class="el-icon-check" v-if="language === value"/>
</el-menu-item> </el-dropdown-item>
</el-submenu> </el-dropdown-menu>
</el-menu> </template>
</el-dropdown>
</template> </template>
<script> <script>
@ -85,6 +83,13 @@ export default {
</script> </script>
<style scoped> <style scoped>
.dropdown-link {
cursor: pointer;
font-size: 12px;
color: rgb(245, 245, 245);
line-height: 40px;
padding-right: 20px;
}
.el-icon-check { .el-icon-check {
color: #44b349; color: #44b349;