Ember.js Bootstrap活动标签

时间:2015-09-22 14:26:07

标签: javascript twitter-bootstrap ember.js

我正在使用Ember.js和Bootstrap来创建一个应用程序。该应用程序有2个路由accounts.devices.devices1和accounts.devices.devices2。我不需要路由accounts.devices但它可以在必要时存在。但不应该有它的链接。我遇到了活跃的问题。在accounts.devices.devices1页面上,设备1的链接被设置为活动,但我还想要指向accounts.devices的链接。基本上,每当下拉列表中的子项处于活动状态时,我也希望父项处于活动状态。这不会将父活动仅设置为子活动:

<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Devices<span class="caret"></span></a>
  <ul class="dropdown-menu">
    {{#link-to 'accounts.devices.devices1' tagName='li'}}<a href={{view.href}}>Devices 1</a>{{/link-to}}
    {{#link-to 'accounts.devices.devices2' tagName='li'}}<a href={{view.href}}>Devices 2</a>{{/link-to}}
  </ul>
</li>

此代码将父级设置为活动,但在单击下拉列表而不是打开下拉列表时,还会创建指向accounts.devices的链接。此外,设备1和设备2的链接无法正常工作。

{{#link-to 'accounts.devices' tagName='li' class='dropdown'}}
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Devices<span class="caret"></span></a>
  <ul class="dropdown-menu">
    {{#link-to 'accounts.devices.devices1' tagName='li'}}<a href={{view.href}}>Devices 1</a>{{/link-to}}
    {{#link-to 'accounts.devices.devices2' tagName='li'}}<a href={{view.href}}>Devices 2</a>{{/link-to}}
  </ul>
{{/link-to}}

应该怎么做?

1 个答案:

答案 0 :(得分:2)

public class Application_Controler implements Initializable { @FXML private TextField txt; @FXML private TextArea showTxt; @Override public void initialize(URL location, ResourceBundle resources) { showTxt.textProperty().bind(txt.textProperty()); } } 添加到顶级disabled=true

link-to