<template>
|
<div class="lang">
|
<fx-header>
|
<template #title>
|
{{ $t('setLanguage') }}
|
</template>
|
</fx-header>
|
<div v-for="(item, index) in lang" :key="index" class="lang-padding" @click="handleSetLang(item.key)">
|
<div class="lang-title flex items-center font-13 textColor">
|
<img class="h-6 mr-3" :src="item.image" alt="">
|
{{ item.title }}
|
</div>
|
<div class="lang-flex"></div>
|
<img v-if="item.key == locale" src="../../assets/image/public/checked.png" style="width: 20px;height: 20px;" />
|
</div>
|
</div>
|
</template>
|
<script setup>
|
import { ref, onMounted } from "vue";
|
import { useI18n } from "vue-i18n";
|
import { SET_LANGUAGE } from '@/store/types.store'
|
import { useLanguageStore } from '@/store/language.store'
|
import { lang } from '@/config/index'
|
const { locale, t } = useI18n()
|
|
const languageStore = useLanguageStore()
|
|
// let lang = lang
|
|
onMounted(() => {
|
console.log(locale.value)
|
})
|
const handleSetLang = (lang) => {
|
locale.value = lang
|
languageStore[SET_LANGUAGE](lang)
|
}
|
|
</script>
|
<style lang="scss" scoped>
|
.lang {
|
width: 100%;
|
box-sizing: border-box;
|
}
|
|
.CommonProblem-padding {
|
padding-left: 25px;
|
padding-right: 25px;
|
}
|
|
.lang-padding {
|
padding: 15px 18px 22px 18px;
|
box-sizing: border-box;
|
// border-bottom: 1px solid $border_color;
|
font-weight: 400;
|
font-size: 18px;
|
color: $text_color;
|
display: flex;
|
}
|
|
.lang-flex {
|
flex: 1;
|
}
|
</style>
|