资讯详情

Vue3 Typescript Vite使用国际化 Vue-i18n 报错 Cannot read properties of undefined (reading ‘__...

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘__composer’) 在这里插入图片描述

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '__composer')    vue-i18n.esm-bundler.js:1756      at Proxy.mounted (vue-i18n.esm-bundler.js:1756:52)     at callWithErrorHandling (runtime-core.esm-bundler.js:155:22)     at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:164:21)     at hook.__weh.hook.__weh (runtime-core.esm-bundler.js:2687:29)     at flushPostFlushCbs (runtime-core.esm-bundler.js:358:32)     at flushJobs (runtime-core.esm-bundler.js:403:9) 

解决方案

在使用的时候`import { createI18n } from 'vue-i18n会报错,改成以下方式就好。

import { 
         createI18n } from 'vue-i18n/index'; 

标签: weh快速连接器tvr60

锐单商城拥有海量元器件数据手册IC替代型号,打造 电子元器件IC百科大全!

锐单商城 - 一站式电子元器件采购平台