0

I am newbie in meteor and I am trying to build simple website. Now we can define header,container in jade by simple doing it:

!!!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

But in meteor we do by:

head
  title helloworld
body
  {{> hello}}



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

Now my question is how can we define container, main-content in meteor ??

Thank You in advance!!!!

4

1 回答 1

1

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

所以你可以这样做:

索引.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,而且我也是流星新手(但话说回来,谁不是):)

于 2013-06-24T09:48:15.577 回答