我才刚刚开始真正深入 Meteor 并开始一些个人项目,但我偶然发现了一些我还没有找到答案的东西。我正在尝试设置用于登录、注册等页面的标题。是否有解决方案?我在文档中看不到可以在这些配置语句中添加选项的任何地方。
这是我的routes.jsx
文件:
AccountsTemplates.configureRoute("changePwd");
AccountsTemplates.configureRoute("forgotPwd");
AccountsTemplates.configureRoute("resetPwd");
AccountsTemplates.configureRoute("signIn");
AccountsTemplates.configureRoute("signUp");
AccountsTemplates.configureRoute("verifyEmail");
谢谢!
最佳答案
您应该能够通过以下方式实现这一目标:
FlowRouter.triggers.enter([function(){
document.title = FlowRouter.current().path;
]);
这将设置页面标题 = 所有路由的路由路径。如果您想要特定于路线的标题,则可以在每条路线上单独添加触发器。 (docs)
关于javascript - 使用用户帐户设置页面标题 :flow-router,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34302436/