多语言切换icon及切换方式代码调整
This commit is contained in:
parent
60f1f0dde4
commit
d4f1f15491
BIN
src/assets/images/header/en.png
Normal file
BIN
src/assets/images/header/en.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 522 B |
BIN
src/assets/images/header/zh.png
Normal file
BIN
src/assets/images/header/zh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 446 B |
|
@ -1,7 +1,11 @@
|
|||
<template>
|
||||
<div class="user-wrapper" :class="theme">
|
||||
<span @click="changeLang('zh-CN')">zh</span>
|
||||
<span style="margin-left: 10px;" @click="changeLang('en-US')">en</span>
|
||||
<span class="language" @click="changeLang">
|
||||
<img :src="$i18n.locale=='zh-CN'?langIcon_en:langIcon_zh" alt="">
|
||||
<!-- <img :src=langIcon_zh alt=""> -->
|
||||
</span>
|
||||
<!-- <span @click="changeLang('zh-CN')">zh</span>
|
||||
<span style="margin-left: 10px;" @click="changeLang('en-US')">en</span> -->
|
||||
<header-notice class="action"/>
|
||||
<a-dropdown>
|
||||
<span class="action action-full ant-dropdown-link user-dropdown-menu">
|
||||
|
@ -65,7 +69,9 @@ import i18nMixin from '@/store/i18n-mixin'
|
|||
name: "UserMenu",
|
||||
mixins: [mixinDevice,i18nMixin],
|
||||
data(){
|
||||
return{
|
||||
return {
|
||||
langIcon_zh:require('@/assets/images/header/zh.png'),
|
||||
langIcon_en:require('@/assets/images/header/en.png'),
|
||||
// update-begin author:sunjianlei date:20200219 for: 头部菜单搜索规范命名 --------------
|
||||
searchMenuOptions:[],
|
||||
searchMenuComp: 'span',
|
||||
|
@ -90,9 +96,10 @@ import i18nMixin from '@/store/i18n-mixin'
|
|||
created() {
|
||||
let lists = []
|
||||
this.searchMenus(lists,this.permissionMenuList)
|
||||
this.searchMenuOptions=[...lists]
|
||||
this.searchMenuOptions = [...lists]
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.$i18n.locale);
|
||||
//如果是单点登录模式
|
||||
if (process.env.VUE_APP_SSO == 'true') {
|
||||
let depart = this.userInfo().orgCode
|
||||
|
@ -121,9 +128,10 @@ import i18nMixin from '@/store/i18n-mixin'
|
|||
// update-end author:sunjianlei date:20200219 for: 菜单搜索改为动态组件,在手机端呈现出弹出框
|
||||
},
|
||||
methods: {
|
||||
changeLang(key) {
|
||||
this.$i18n.locale = key
|
||||
this.setLang(key)
|
||||
changeLang() {
|
||||
let lang = this.$i18n.locale == "zh-CN" ? "en-US" : "zh-CN"
|
||||
this.$i18n.locale = lang
|
||||
this.setLang(lang)
|
||||
},
|
||||
/* update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
|
||||
showClick() {
|
||||
|
@ -243,6 +251,17 @@ import i18nMixin from '@/store/i18n-mixin'
|
|||
}
|
||||
}
|
||||
}
|
||||
.language{
|
||||
display: inline-block;
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
cursor: pointer;
|
||||
margin-right: 5px;
|
||||
img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
/* update-end author:sunjianlei date:20191220 for: 解决全局样式冲突问题 */
|
||||
/* update_end author:zhaoxin date:20191129 for: 让搜索框颜色能随主题颜色变换*/
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue
Block a user