简体   繁体   English

Ember.js模板布局

[英]Ember.js template layout

I'm new to ember development and attempting to make my first app. 我是炭烬开发和尝试制作我的第一个应用程序的新手。 In my application template I have a menu bar with an {outlet} tag underneath to accept other templates. 在我的应用程序模板中,我的菜单栏下方带有一个{outlet}标签,以接受其他模板。 My problem is that the menubar goes down the left of the page and I want the {outlet} content to be beside it on the right, not underneath. 我的问题是菜单栏位于页面左侧,我希望{outlet}内容位于右侧,而不是下方。

I have been googling how to do this but have only managed to get it to float right, still underneath the menubar. 我一直在谷歌搜索该怎么做,但只设法使其仍然浮动在菜单栏下方。 Can someone tell me how to do it? 有人可以告诉我该怎么做吗? Preferably without having to use some complicated css? 最好不必使用一些复杂的CSS?

<script type="text/x-handlebars" id="application">
    <div class="main">
    <ul class="nav nav-pills nav-stacked" style="max-width: 300px;">
      <li class="active">
      <a href="#"<span class="glyphicon glyphicon-home"></span>  Dashboard</a>
      </li>
      <li>
      <a href="#"<span class="glyphicon glyphicon-user"></span>  Agents</a>
      </li>
      <li>
      <a href="#"<span class="glyphicon glyphicon-list"></span>  Queues</a>
      </li>
      <li>
      <a href="#"<span class="glyphicon glyphicon-signal"></span>  Analytics</a>
      </li>
      <li>
      <a href="#"<span class="glyphicon glyphicon-wrench"></span>  Settings</a>
      </li>
      <li>
      <a href="#"<span class="glyphicon glyphicon-arrow-right"></span>  Logout</a>
      </li>
    </ul>
    </br>

      {{outlet}}
    </div>
  </script>

If you are using bootstrap, you can use the columns class col-md-x 如果使用引导程序,则可以使用列类col-md-x

<div class="container">
    <div class="col-md-2">
        your navs
    </div>
    <div class="col-md-10">
        {{outlet}}
    </div>
</div>

Give a look in that sample http://emberjs.jsbin.com/EJifOyaX/1 And in the code http://emberjs.jsbin.com/EJifOyaX/1/edit 看一下该示例http://emberjs.jsbin.com/EJifOyaX/1和代码http://emberjs.jsbin.com/EJifOyaX/1/edit

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM