docs: 更正语言使用示例,确保可用

使用可用的语言配置
修复computed变量使用语法错误

closed #8159
This commit is contained in:
陆伯言
2026-07-19 01:22:00 +08:00
parent fe65d548be
commit 41c20a43af
2 changed files with 6 additions and 6 deletions

View File

@@ -89,11 +89,11 @@ With `@vben/locales`, you can easily use translation texts:
import { computed } from 'vue';
import { $t } from '@vben/locales';
const items = computed(() => [{ title: $t('about.desc') }]);
const items = computed(() => [{ title: $t('demos.title') }]);
</script>
<template>
<div>{{ $t('about.desc') }}</div>
<template v-for="item in items.value">
<div>{{ $t('demos.title') }}</div>
<template v-for="item in items">
<div>{{ item.title }}</div>
</template>
</template>

View File

@@ -89,11 +89,11 @@ updateLocale('en-US');
import { computed } from 'vue';
import { $t } from '@vben/locales';
const items = computed(() => [{ title: $t('about.desc') }]);
const items = computed(() => [{ title: $t('demos.title') }]);
</script>
<template>
<div>{{ $t('about.desc') }}</div>
<template v-for="item in items.value">
<div>{{ $t('demos.title') }}</div>
<template v-for="item in items">
<div>{{ item.title }}</div>
</template>
</template>