【问题标题】:How do i achieve this nested layout in meteor?我如何在流星中实现这种嵌套布局?
【发布时间】:2016-02-08 11:06:34
【问题描述】:

我正在尝试使用 MeteorJS 构建应用程序。我的主要布局有一个 topnav 和一个 yield。

-------------------------------------
|               TopNav              |
-------------------------------------
|                                   |
|                                   |
|              Yield                |
|                                   |                                                
|                                   |
|                                   |
-------------------------------------

但是在应用程序的某些页面上,yield 内的模板需要有一个侧边栏和另一个嵌套子模板的地方。

----------------------------------------------------------
| item1                   |                              |                               
| item2                   |                              |                                    
| item3                   |                              |                                                       
| item4                   |                              |
| item5                   |          Corresponding       |
|                         |            Templates         |
|                         |                              |                         
|                         |                              |
|                         |                              |                       
|                         |                              |
|                         |                              |
----------------------------------------------------------

我如何做到这一点。我正在使用 Iron-router。

【问题讨论】:

    标签: meteor iron-router meteor-blaze


    【解决方案1】:

    只需创建一个包装模板来容纳另外两个,并使用 CSS 将它们正确定位...

    <template name="left"> ... </template>
    <template name="right"> ... </template>
    <template name="wrapper"> 
       {{>left}}
       {{>right}}
    </template>
    

    然后将模板包装器加载到您的产量中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-16
      • 1970-01-01
      • 2013-09-09
      • 1970-01-01
      • 1970-01-01
      • 2017-11-25
      相关资源
      最近更新 更多