Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于如何动态加载多语言文件 #245

Open
Sunny-liaokai opened this issue Feb 18, 2024 · 0 comments
Open

关于如何动态加载多语言文件 #245

Sunny-liaokai opened this issue Feb 18, 2024 · 0 comments

Comments

@Sunny-liaokai
Copy link

Sunny-liaokai commented Feb 18, 2024

`function loadLocaleData(locale: string) {

import(@/locales/${locale}).then(async module => {

await intl.init({
  currentLocale: locale,
  locales: {
    [locale]: module.default
  }
})

})

}`
以上是我的代码,我在服务端页面构建的之前执行 loadLocaleData(locale)方法
到客户端的渲染的时候报错
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant