2

我才刚刚开始真正潜入 Meteor 并开始一些个人项目,但我偶然发现了一些我还没有找到答案的东西。我正在尝试设置用于登录、注册等的页面标题。有解决方案吗?我在文档中看不到可以在这些配置语句中添加选项的任何地方。

这是我的routes.jsx文件:

AccountsTemplates.configureRoute("changePwd");
AccountsTemplates.configureRoute("forgotPwd");
AccountsTemplates.configureRoute("resetPwd");
AccountsTemplates.configureRoute("signIn");
AccountsTemplates.configureRoute("signUp");
AccountsTemplates.configureRoute("verifyEmail");

谢谢!

4

1 回答 1

2

您应该能够通过以下方式实现这一目标:

FlowRouter.triggers.enter([function(){
  document.title = FlowRouter.current().path;
]);

这将设置页面标题 = 所有路线的路线路径。如果您想要特定于路线的标题,那么您可以在每条路线上单独添加触发器。(文档)

于 2015-12-16T01:39:20.120 回答