小编ser*_*rgi的帖子

如何在Iron Router blaze集成上正确替换this.stop()with pause()

当我将Iron Router升级到blaze集成分支时,我开始收到此警告:

"You called this.stop() inside a hook or your action function but you should use pause() now instead" 
Run Code Online (Sandbox Code Playgroud)

Chrome控制台 - > iron-router.js:2104 - > client/route_controller.js:193 from package

代码在客户端:

Router.before(mustBeSignedIn, {except: ['userSignin', 'userSignup', 'home']});

var mustBeSignedIn = function () {
    if (!Meteor.user()) {
        // render the home template 
        this.redirect('home');
        // stop the rest of the before hooks and the action function 
        this.stop();
        return false;
    }
    return true;
}
Run Code Online (Sandbox Code Playgroud)

我试着更换this.stop()同:pause(),Router.pause()this.pause(),但仍然无法正常工作.另外我还没有在铁路由器包上找到暂停功能.

如何正确更换this.stop()用 …

meteor iron-router

8
推荐指数
2
解决办法
2266
查看次数

流星面包屑

如何使用Meteor和铁路由器实现反应式面包屑?

现在我正在寻找当前路径,由一个被动会话变量触发,然后使用jQuery添加与DOM内该路由相对应的每个链接.

meteor iron-router

5
推荐指数
2
解决办法
1487
查看次数

标签 统计

iron-router ×2

meteor ×2