我最近升级到 Ember RC7。我有一些引导选项卡,它们通过以下方式使用“linkTo”映射到一些子路由:
{{#linkTo page.tab1 this href=false tagName=li}}{{#linkTo page.tab1}}tab 1{{/linkTo}}{{/linkTo}}
{{#linkTo page.tab2 this href=false tagName=li}}{{#linkTo page.tab2}}tab 2{{/linkTo}}{{/linkTo}}
在 RC7 之前,这一直没有问题。我现在收到以下警告:
DEBUG: ------------------------------- ember.js:364
DEBUG: Ember.VERSION : 1.0.0-rc.7 ember.js:364
DEBUG: Handlebars.VERSION : 1.0.0 ember.js:364
DEBUG: jQuery.VERSION : 1.9.1 ember.js:364
DEBUG: ------------------------------- ember.js:364
render combined-scripts.js:995
DEPRECATION: You provided a quoteless destination route parameter of page.tab1 to the linkTo helper. Soon, this will perform a property lookup, rather than be treated as a string. To get rid of this warning, wrap form.index in quotes. To opt in to this new behavior, set ENV.HELPER_PARAM_LOOKUPS = true
at null.<anonymous> (http://localhost:9001/bower_components/ember/ember.js:28036:15)
at Object.anonymous (http://localhost:9001/scripts/compiled-templates.js:225:72)
at Handlebars.VM.template (http://localhost:9001/bower_components/handlebars/handlebars.js:2212:33)
at Ember.View.Ember.CoreView.extend.render (http://localhost:9001/bower_components/ember/ember.js:16826:16)
at Ember.CoreView.Ember.Object.extend._renderToBuffer (http://localhost:9001/bower_components/ember/ember.js:15767:10)
at Ember.View.Ember.CoreView.extend._renderToBuffer (http://localhost:9001/bower_components/ember/ember.js:17406:23)
at superWrapper [as _renderToBuffer] (http://localhost:9001/bower_components/ember/ember.js:1082:16)
at null.<anonymous> (http://localhost:9001/bower_components/ember/ember.js:15748:19)
at Object.Ember.Instrumentation.instrument (http://localhost:9001/bower_components/ember/ember.js:1465:20)
我尝试将 page.tab1 和 page.tab2 放在引号中,但是我的链接无法正常工作,就好像打破了 2 路绑定一样。关于如何解决这个问题的任何想法?
UPDATE 添加了一个 JSBin 示例:请注意,当您单击“下一步”按钮时,链接 url 不会更新到新项目,即使名称字段会更新。即单击下一步按钮,即使它应该是 /item/2,url 仍将保持 /item/1