提交 47c04de4 编写于 作者: fxy060608's avatar fxy060608

chore: Compatible with old compiler

上级 d9991125
...@@ -2156,7 +2156,7 @@ var serviceContext = (function (vue) { ...@@ -2156,7 +2156,7 @@ var serviceContext = (function (vue) {
}); });
function initI18n() { function initI18n() {
const localeKeys = Object.keys(__uniConfig.locales); const localeKeys = Object.keys(__uniConfig.locales || {});
if (localeKeys.length) { if (localeKeys.length) {
const i18n = useI18n(); const i18n = useI18n();
localeKeys.forEach((locale) => i18n.add(locale, __uniConfig.locales[locale])); localeKeys.forEach((locale) => i18n.add(locale, __uniConfig.locales[locale]));
......
...@@ -2,7 +2,7 @@ import { BuiltInLocale } from '@dcloudio/uni-i18n' ...@@ -2,7 +2,7 @@ import { BuiltInLocale } from '@dcloudio/uni-i18n'
import { useI18n } from '../../i18n' import { useI18n } from '../../i18n'
export function initI18n() { export function initI18n() {
const localeKeys = Object.keys(__uniConfig.locales) const localeKeys = Object.keys(__uniConfig.locales || {})
if (localeKeys.length) { if (localeKeys.length) {
const i18n = useI18n() const i18n = useI18n()
localeKeys.forEach((locale) => localeKeys.forEach((locale) =>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册