Router.go()发生了什么?

Mic*_*ard 2 meteor

这个命令在铁路由器中是否仍然存在?为什么我收到此错误?

TypeError: Object function router(req, res, next) {                                                          // 13
    //XXX this assumes no other routers on the parent stack which we should probably fix      // 14
    router.dispatch(req.url, {                                                                // 15
      request: req,                                                                           // 16
      response: res                                                                           // 17
    }, next);                                                                                 // 18
  } has no method 'go'
Run Code Online (Sandbox Code Playgroud)

Mic*_*ard 6

你必须将它包装在"if(Meteor.isClient)"中,如果它将在启动时运行.这很有趣,因为你可以调用未被包装的Router.route()并且它们运行正常.