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

umi升级3.0后配置title:true会报错 #7

Open
xiaop572 opened this issue Apr 22, 2020 · 2 comments
Open

umi升级3.0后配置title:true会报错 #7

xiaop572 opened this issue Apr 22, 2020 · 2 comments

Comments

@xiaop572
Copy link

袁老师,umi升级3.0后配置title:true会报错
现在要在配置式约定中配置或者使用react-helment配置了吗
image

@xiaop572
Copy link
Author

title
Type: string
Default: ''
配置标题。

比如:

export default {
title: 'hi',
}
此外,你还可以针对路由配置标题,比如,

export default {
title: 'hi',
routes: [
{ path: '/', title: 'Home' },
{ path: '/users', title: 'Users' },
{ path: '/foo', },
],
}
然后我们访问 / 标题是 Home,访问 /users 标题是 Users,访问 /foo 标题是默认的 hi。

注意:

默认不会在 HTML 里输出 <title> 标签,通过动态渲染得到
配 exportStatic 后会为每个 HTML 输出 <title> 标签
如果需要自行通过 react-helment 等方式渲染 title,配 title: false 可禁用内置的 title 渲染机制

@yjisme
Copy link
Collaborator

yjisme commented Apr 22, 2020 via email

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

2 participants