2013-08-23 48 views
0

我的一个模板中显示了一些引导标签:Bootstrap.Tabs视图不显示选定的选项卡为活动

{{view Bootstrap.Tabs 
    contentBinding="controller.content" 
    selectionBinding="controller.selection"}} 

以下模型:

SettingsApp.ProfileRoute = Ember.Route.extend({ 
    model: function() { 
     var model = Ember.A([ 
      Ember.Object.create({title:t('profile.user'),  link:'#/profile/user'}), 
      Ember.Object.create({title:t('profile.company'), link:'#/profile/company'}), 
      Ember.Object.create({title:t('profile.product'), link:'#/profile/products/index'}), 
     ]); 
     return model; 
    }, 
}); 

这是工作的罚款:标签显示并且链接正在工作。当单击一个选项卡时,将激活相应的路由, Bootstrap.Tabs视图不突出显示所选选项。所有选项都显示为不活动。

在我的(复杂)应用程序中,我的操作和jsbin一样,但jsbin按预期工作:选中该选项卡时显示为活动状态。

在我的应用程序中会出现什么问题?对这个奇怪现象的任何调试建议?

回答

1

到Digg多进Ember.LinkView的内部运作这是获得被实例为{{#linkTo}}助手,你可以看到它的财产active和检查,如果它得到的也改变了你的(复杂)应用程序的视图。

Ember.LinkView.reopen({ 
    activeChanged: function() { 
    console.log('active'); 
    }.observes('active') 
}); 

我已将此添加到您的jsbin demo,并且在那里它显然工作正常。

希望它可以帮助

相关问题