gpt4 book ai didi

ember.js - Ember 更新后 LinkTo 无法使用

转载 作者:行者123 更新时间:2023-12-03 06:22:15 26 4
gpt4 key购买 nike

更新应用程序包(Ember 从 rc6 到 1.0.0、handlebars 从 rc4 到 1.0.0、jquery 从 1.9.1 到 2.0.3)后,我的所有 linkTo 助手都停止工作;如果我点击链接,我会收到此警告:

This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid. 

其他一切似乎都没问题;有人可以解释一下吗?

这是我的路由器:

this.resource('eng', function(){
this.route('home');
this.route('aboutUs', {path: 'about-us'});
this.route('newsArchive', {path: 'news-archive'});
this.route('mattressesAreas', {path: 'mattresses-areas'});
this.resource('eng.rent', {path: 'rent' }, function(){
this.route('boulderSmall', {path: 'boulder-small'});
this.route('boulderXl', {path: 'boulder-xl'});
this.route('leadClimbing', {path: 'lead-climbing'});
this.route('speedClimbing', {path: 'speed-climbing'});
this.route('leadClimbingTurret', {path: 'lead-climbing-turret'});
this.route('mattresses', {path: 'mattresses'});
});
this.resource('eng.factory', {path: 'factory'}, function(){
this.route('panelType', {path: 'panel-type'});
this.route('exteriorFinishing', {path: 'exterior-finishing'});
this.route('buildingSystem', {path: 'building-system'});
this.route('design');
});
this.resource('eng.holds', {path: 'holds'}, function(){
this.route('importClimbingVolumes', {path: 'import-climbing-volumes'});
});
this.resource('eng.team', {path: 'team'}, function(){
this.route('alePenna', {path: 'ale-penna'});
});
this.resource('eng.photoGallery', {path: 'photo-gallery'}, function(){
this.route('evolutionClimbing', {path: 'evolution-climbing'});
this.route('pragelatoBoulder', {path: 'pragelato-boulder'});
});
this.route('contacts');
//error catch all
this.route('404', { path: '*:' });

});

这是我的链接示例:

{{#linkTo eng.aboutUs class="nav ck_0"}}About us{{/linkTo}}

最佳答案

是的,最后我发现我只需要在 linkTo helper 的引号之间写下路由名称,如下所示:

{{#linkTo 'eng.aboutUs' class="nav ck_0"}}About us{{/linkTo}}

我不知道为什么以前在没有引号的情况下工作,现在不行,可能在最新的 Ember 中发生了一些变化......

关于ember.js - Ember 更新后 LinkTo 无法使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19067506/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com