Meteor | iron-router | Router.map和Router.route有什么区别

abl*_*ian 19 meteor iron-router

如上所述,使用流星铁路由器包时,Router.map和Router.route有什么区别?
本教程中,使用'Router.route'.
但在本教程中,使用'Router.map'.
那么我使用'Router.map'的情况和我使用的'Router.route'的情况是什么?

小智 21

他们是做同样事情的不同方式.虽然在新的铁路由器中不推荐使用Router.map,但是你应该使用Router.route(尽管为了向后兼容,Router.map也可以工作).