javascript - 使用用户帐户设置页面标题 :flow-router

标签 javascript meteor meteor-accounts flow-router

我才刚刚开始真正深入 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/

相关文章:

javascript - 如何在删除节点后使用 fancytree 小部件(Yii2)重新加载整个树

javascript - 在某个事件发生后向 ng-repeat 中的元素添加一个类

Meteor 帐户框架签名/登录事件

meteor 账号注册

javascript - Owl Carousel 2 - 拖动方向

javascript - 使用 jQuery 从 href ="tel:"属性中删除无效字符

javascript - 通过模板传递方法参数

javascript - 如何在 Meteor App 中包含本地 JS 文件?

meteor - 如何防止 Meteor 的账户自动发布当前用户的电子邮件?

javascript - 在 Meteor js 中同时登录的两个同时用户