【问题标题】:How can we add wrapper,container in meteor through jade and coffescript?我们如何通过玉和咖啡脚本在流星中添加包装器,容器?
【发布时间】:2013-06-24 08:02:37
【问题描述】:

我是流星的新手,我正在尝试建立简单的网站。现在我们可以通过简单的操作在jade中定义header,container:

!!!5
html
  head
    title #{title} - helloworld
    link(rel='stylesheet', href='/stylesheets/style.css')
  body
    header
      h1 helloworld
    .container
      .main-content
        block content
      .sidebar
        block sidebar
    footer
      p Running on node with Express, Jade and Stylus

但是在meteor中,我们通过:

head
  title helloworld
body
  {{> hello}}



template(name="hello")
p this is helloworld

现在我的问题是我们如何在流星中定义容器、主要内容??

提前谢谢你!!!!

【问题讨论】:

    标签: meteor pug stylus


    【解决方案1】:

     您的 index.htmlwhatever_template.html 只是 html。 您可以将任何容器放入该 html 中,并将您的车把放入其中。

    所以你可以这样做:

    index.html

    head
      title helloworld
    body
      .container
        {{> hello}}
    

    你好.html

    template(name="hello")
    .another-container
      p this is helloworld
    

    这会给你类似的东西:

    head
      title helloworld
    body
      .container
        .another-container
          p this is helloworld
    

    (免责声明:我从未使用过 Jade,而且我也是流星新手(但话说回来,谁不是):)

    【讨论】:

      猜你喜欢
      • 2015-03-26
      • 2023-03-14
      • 2023-03-23
      • 1970-01-01
      • 2018-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-23
      相关资源
      最近更新 更多