alibaba / rax

🐰 Rax is a progressive framework for building universal application. https://rax.js.org
Other
7.99k stars 627 forks source link

[Question]国际化Provider报错 #2221

Closed swl880422 closed 3 years ago

swl880422 commented 3 years ago

import { IntlProvider, addLocaleData } from 'react-intl'; image

wjq990112 commented 3 years ago

方便看下报错详情吗?鼠标悬浮在错误代码上会弹框?

swl880422 commented 3 years ago

Screen Shot 2021-08-19 at 4 12 19 PM

swl880422 commented 3 years ago

Screen Shot 2021-08-19 at 4 12 54 PM

swl880422 commented 3 years ago

另有几个问题:

  1. 动态切换语言,provider要怎么处理呢?
  2. tab如何国际化呢?
wjq990112 commented 3 years ago

从这个报错提示来看基本都是 TS 类型的报错,可以结合一下 d.ts 文件来定位一下是什么问题

swl880422 commented 3 years ago

不引入react-intl, 自己实现了一下。 剩下的问题就是 tab 不知道如何国际化,看了一下很多原生小程序也没有提供方案。先关闭问题了,目前用国际化只是web版,只要不使用tab配置的情况下还是可以的。