将Backbone.Router.navigate设置test为true:
var test = false;
var Router = Backbone.Router.extend({
routes: {
'posts': 'showPosts'
},
showPosts: function () {
test = true;
}
});
router = new Router();
Backbone.history.start();
router.navigate('posts?foo=3', {trigger: true});
assert.ok(test);
Run Code Online (Sandbox Code Playgroud)
例如,默认情况下posts?foo=3片段是否与posts路径匹配,或者我是否必须为此设置另一条路径,例如:posts?*querystring?
谢谢
PS:我知道存在骨干查询参数,但我想知道骨干.