mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
add language selector
This commit is contained in:
parent
9940c0ad36
commit
5fc46f15b5
2 changed files with 41 additions and 1 deletions
32
frontend/src/components/SetLanguage/SetLanguage.vue
Normal file
32
frontend/src/components/SetLanguage/SetLanguage.vue
Normal file
|
@ -0,0 +1,32 @@
|
|||
<template>
|
||||
<div>
|
||||
<a-select v-model="current" size="small" style="width: 50px">
|
||||
<a-select-option v-for="(language, key) in $language.available" :value="key" :key="key">
|
||||
{{ language }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'SetLanguage',
|
||||
data() {
|
||||
return {
|
||||
current: this.$language.current,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
current() {
|
||||
this.$store.commit('set_language', this.current)
|
||||
this.$nextTick(() => {
|
||||
location.reload()
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
</style>
|
|
@ -4,6 +4,8 @@
|
|||
<a-icon type="menu-unfold" @click="$emit('clickUnFold')"/>
|
||||
</div>
|
||||
<div class="user-wrapper">
|
||||
<set-language class="set_lang" />
|
||||
|
||||
<a href="/">
|
||||
<a-icon type="home"/>
|
||||
</a>
|
||||
|
@ -16,9 +18,10 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import SetLanguage from '@/components/SetLanguage/SetLanguage'
|
||||
export default {
|
||||
name: 'HeaderComponent',
|
||||
components: {},
|
||||
components: {SetLanguage},
|
||||
methods: {
|
||||
logout() {
|
||||
this.$api.auth.logout().then(() => {
|
||||
|
@ -59,4 +62,9 @@ export default {
|
|||
position: fixed;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.set_lang {
|
||||
display: inline;
|
||||
margin-right: 25px;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue