Skip to content

Commit 76c6ff2

Browse files
🐛 修正数据对象中的语言属性名称
1 parent 3167283 commit 76c6ff2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/plugins/i18n.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ export default defineNuxtPlugin((app) => {
3232
const data = useData(
3333
z
3434
.object({
35-
_lang: z.nativeEnum(Languages).optional(),
35+
lang: z.nativeEnum(Languages).optional(),
3636
})
3737
.readonly(),
3838
);
39-
if (!data._lang) {
39+
if (!data.lang) {
4040
return;
4141
}
4242
const nuxtApp = useNuxtApp();
43-
nuxtApp.$i18n.locale.value = data._lang;
43+
nuxtApp.$i18n.locale.value = data.lang;
4444
} catch (e) {
4545
console.error(e);
4646
return;

0 commit comments

Comments
 (0)