现在的问题是,项目重新Install,启动就会报错: Uncaught SyntaxError: Not available in legacy mode 在导出国际化时新增 exportconsti18n =createI18n({ ...legacy:false, }); 可以正常启动,但在设置时**proxy.$i18n 变成了空对象**,proxy.$i18n应该是上面导出并且已经在main挂载的i18n。 const setI18nConfig = ...
Uncaught (inpromise) SyntaxError: Not availableinlegacy mode 如图: 解决: createI18n时添加上 legacy:false 如下: const i18n =createI18n({ legacy:false, ... }) 三,测试效果 四,查看vue框架的版本: liuhongdi@lhdpc:/data/vue/i18n$ npm list vue i18n@0.1.0/data/vue/i18n ├─┬ @vue/cli-plug...
import { createI18n } from 'vue-i18n'; import en from './en.json'; import zh from './zh.json'; type MessageSchema = typeof en const i18n = createI18n<[MessageSchema], 'en' | 'zh' >({ legacy: false, locale: 'en', // 默认语言 messages: { en, zh } }); export default i1...
<template> {{t(`SEARCH`)}} </template> import { useI18n } from "vue-i18n"; export default defineComponent({ setup() { const { t } = useI18n(); return{ t } } }) 另:插件报错Uncaught SyntaxError: Not available in legacy mode解决方法 修复这个问题添加 legacy:false 到i18n插件当中发...
__VUE_I18N_FULL_INSTALL__(enable/disable, in addition to vue-i18n APIs, components and directives all fully support installation:true) __VUE_I18N_LEGACY_API__(enable/disable vue-i18n legacy style APIs support, default:true) __INTLIFY_DROP_MESSAGE_COMPILER__(enable/disable whether to tree-sha...
const i18n = createI18n({ legacy: false, //处理报错Uncaught (in promise) SyntaxError: Not available in legacy mode (at message-compiler.esm-bundler.js:54:19) locale: localStorage.getItem('lang') || "zhCN", // 注意locale属性! message ...
Since version v9,vue-i18nhas an extremely weird way ofchanging the global locale, for which the api is different when running in legacy mode: // when vue-i18n is being used with legacy: false, note that i18n.global.locale is a ref, so we must set it via .value:i18n.global.locale.va...
import {createI18n} from 'vue-i18n' import zh from './zh' import en from './en' const i18n = createI18n({ legacy: false, globalInjection: true, locale: localStorage.getItem('locale') || navigator.language.slice(0, 2), messages: { en, zh, } }); export default i18n ...
Product Solutions Resources Open Source Enterprise Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Sign in Sign up Reseting focus intlify / vue-i18n Public Sponsor Notifications Fork 337 Star 2.2k ...
395 * @VueI18nWarning 396 * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`. 397 * 398 * ...