0

试图弄清楚如何在 Backbone 中触发索引路由。

routes:     
    '': 'home'    
    profile': 'init_profile'

然后在 Chrome 控制台中..

app_router.navigate('', { trigger: true, replace: true });

不更改 URL 或触发任何回调。

但是,配置文件路由工作正常:

app_router.navigate('profile', { trigger: true, replace: true });

如何触发索引路由?

4

2 回答 2

1

Backbone.history.navigate('', true)

似乎工作。

于 2013-04-17T13:25:41.920 回答
1

你应该只使用:

app_router.navigate('profile', true);

它应该这样工作。

于 2013-04-16T22:17:21.327 回答