提交 c29bd751 编写于 作者: fantasy_cs's avatar fantasy_cs

*fix : clean LanguageSettings.vue and remove the ant-design commponents

上级 d3e93ecf
......@@ -12,7 +12,7 @@ import {useI18n} from "vue-i18n";
import {useStore} from "vuex";
import {ZentaoData} from "@/store/zentao";
const { t, locale } = useI18n();
const { t } = useI18n();
const store = useStore<{ Zentao: ZentaoData }>();
const openSettings = () => {
......
<template>
<div>{{ t("ui_lang") }}</div>
<div>
<a-radio-group name="radioGroup" v-model:value="locale">
<a-radio
v-for="item in locales"
@change="changeLang(item)"
:key="item"
:value="item"
:style="radioStyle"
>
<span style="margin-left: 5px">{{ languageLabels[item] }}</span>
</a-radio>
</a-radio-group>
<div v-for="item in locales" :key="item" >
<input type="radio" :id="'ui-lang-setting-radio-' + item" :value="item" v-model="locale" @change="changeLang(item)" />
<label :for="'ui-lang-setting-radio-' + item" > {{languageLabels[item] }}</label>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { setI18nLanguage } from "@/config/i18n";
import { useI18n } from "vue-i18n";
const { t, locale } = useI18n();
const radioStyle = ref({
display: "block",
height: "30px",
lineHeight: "30px",
});
const locales: string[] = ["zh-CN", "en-US"];
const languageLabels: { [key: string]: string } = {
"zh-CN": "简体中文",
......@@ -39,6 +25,7 @@ const languageIcons: { [key: string]: string } = {
};
const changeLang = (key): void => {
console.info(key)
setI18nLanguage(key);
};
</script>
\ No newline at end of file
</script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册