我正在设置一个 body helper 与 Iron Router 一起用作 {{route}}
:
Template.body.helpers({
route: function(){
alert(Router.current().route.getName());
}
});
但是 Router.current().route.getName()
返回 undefined 而不是“/thirdPage/”。
最佳答案
尝试:
Router.current().route.path()
关于javascript - 如何在 Iron Router Meteor 中查看当前路线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30732516/