-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: multi-language support for umi-plugin-react
> title
#1482
Conversation
{{/useLocale}} | ||
} | ||
componentWillUnmount() { | ||
document.title = this.props.route._title_default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前的 if (document.title === this.props.route._title) {
这个判断还是要的,不然可能会出现一个 bug。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我也想了这步可能有原因,只是document.title
已经被改了,无法和this.props.route._title
做匹配,那我可能要再加一步了
不支持配置式路由title吗? |
@smithyj 支持的, |
@leftstick 好像并没有生效 |
好像是应该还没发布 |
@sorrycc @leftstick 麻烦推送下 umi-plugin-react 最新包 |
哪个 pr 加的?本地测应该不需要发包吧。 |
close #1487 |
@yutingzhao1991 合并没有成功 |
需要重新加载才生效,不支持动态切换吗? |
Close #1487
为
umi-plugin-react
的title
配置,增加多语言支持,效果如下:在
.umirc.js
中增加如下配置:然后,用户为路由自定义的
title
属性就会作为key
从locales/*.js
里去找对应文字来作为标题了。