我不明白,我尝试将参数转换为请求http://emberjs.com/guides/routing/asynchronous-routing/
我的路由器设置:
App.Router.map(function () {
this.resource('index', {path: '/'});
this.resource('forum', {path: '/forum'}, function(){
this.route('index');
this.route('view', {path: ':forum_id', queryParams: ['page']});
));
});
模板
{{#each forum in forums}}
{{#link-to 'forum.view' forum page=1}}
{{forum.name}}
{{/link-to}}
{{/each}}
但是ember会生成没有我的参数“页面”的链接:
#/forum/52baf4c55a8561601f00002a
为什么?
您启用了该功能吗?
http://emberjs.com/guides/configuring-ember/feature-flags/
您正在使用哪个版本的Ember?根据Docs的介绍,您必须使用Canary构建,因为这是一项实验性功能:
查询参数是一项实验功能。您必须使用Ember的最新金丝雀版本,并启用query-params功能标志
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句