如何使用tagName和Menu分隔符?

时间:2014-05-30 15:01:44

标签: ember.js

我在我的Ember模板和菜单分隔符tagName中使用||,但渲染效果并不尽如人意。例如,当About or Home指向||About出现时,鼠标指针不会转到手。 Products显得正常的地方。有什么问题?

enter image description here

  <script type='text/x-handlebars' data-template-name='application'>
    <div class='navbar navbar-default fixed-top'>
      <div class='container'>
        {{#link-to 'index' class='navbar-brand'}}Ember{{/link-to}}
        <ul class='nav navbar-nav navbar-right'>
          {{#link-to 'index' tagName='li'}}Home{{/link-to}}
          ||
          {{#link-to 'about' tagName='li'}}About{{/link-to}}
          <li>{{#link-to 'products'}}Products{{/link-to}}</li>
        </ul>
      </div>
    </div>
    <div class='container'>
      {{outlet}}
    </div>
  </script>

1 个答案:

答案 0 :(得分:0)

您没有将菜单项包装在<li>

    <ul class='nav navbar-nav navbar-right'>
      <li>{{#link-to 'index' tagName='li'}}Home{{/link-to}}</li>
      <li>||</li>
      <li>{{#link-to 'about' tagName='li'}}About{{/link-to}}</li>
      <li>{{#link-to 'products'}}Products{{/link-to}}</li>
    </ul>