Commit 93eef44d authored by 水落(YangLei)'s avatar 水落(YangLei)

feat: 优化国际化异常的问题

parent e7671869
<template> <template>
<a-dropdown class="lang header-item"> <a-dropdown class="lang header-item">
<div><a-icon type="global" /> {{ langAlias }}</div> <div><a-icon type="global" /> {{ langAlias }}</div>
<a-menu @click="changeLang" :selected-keys="[lang]" slot="overlay"> <a-menu @click="change" :selected-keys="[lang]" slot="overlay">
<a-menu-item v-for="lang in langList" :key="lang.key"> <a-menu-item v-for="lang in langList" :key="lang.key">
{{ lang.key.toLowerCase() + ' ' + lang.name }} {{ lang.key.toLowerCase() + ' ' + lang.name }}
</a-menu-item> </a-menu-item>
...@@ -27,10 +27,9 @@ export default { ...@@ -27,10 +27,9 @@ export default {
}, },
}, },
methods: { methods: {
change(langKey) { change({ key }) {
this.$i18n.locale = langKey; langUtils.set(key);
this.lang = langKey; window.location.reload();
langUtils.set(langKey);
}, },
}, },
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment