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

Bug: 应动态设置页面标题 #438

Closed
y-young opened this issue Mar 7, 2023 · 6 comments · Fixed by #512
Closed

Bug: 应动态设置页面标题 #438

y-young opened this issue Mar 7, 2023 · 6 comments · Fixed by #512
Milestone

Comments

@y-young
Copy link
Contributor

y-young commented Mar 7, 2023

每个页面应该设置不同的标题

不知道除了 react-helmet 之外还有没有更好的办法?

@cokemine
Copy link
Contributor

cokemine commented Mar 7, 2023

如果只改 title 可以只在 useEffect 改 document.title

@y-young
Copy link
Contributor Author

y-young commented Mar 7, 2023

如果只改 title 可以只在 useEffect 改 document.title

不能每个地方都写一遍吧,得封装一下

@cokemine
Copy link
Contributor

cokemine commented Mar 7, 2023

对,可以封装成一个 hook

@Ayase-252
Copy link
Contributor

Ayase-252 commented Mar 8, 2023

helmet 也行吧,不知道以后会不会有定制 head 内 tag 的场景

但为啥这不是原始的 react-helmet?

@y-young
Copy link
Contributor Author

y-young commented Mar 8, 2023

helmet 也行吧,不知道以后会不会有定制 head 内 tag 的场景

现在不同页面会有不同的 meta title 和 meta description 之类的,为了 SEO 的话也是需要的吧

但为啥这不是原始的 react-helmet?

这个貌似不维护了……

@trim21 trim21 modified the milestones: v0.0.1, 0.0.0-alpha.0, next-next, next Mar 18, 2023
@trim21
Copy link
Contributor

trim21 commented Mar 27, 2023

收到通知时给标题加上一个 (n) ... 的前缀

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

Successfully merging a pull request may close this issue.

4 participants