是否可以将Jade继承与Meteor一起使用?

时间:2015-07-26 17:43:40

标签: inheritance meteor pug

我通过meteor-jade package组合使用Meteor和Jade,并希望利用Jade的template inheritance支持来创建几个类似的视图。流星玉有可能吗?

我尝试编写一个layout.jade文件,并将其扩展到另一个模板中,但问题是其内容必须包含在template标记中,然后将其呈现为HTML。

示例Jade文件

layout.jade

//- Doesn't work since Meteor requires content to be in a template tag
.modal.fade(class=modalClass tabindex="-1" role="dialog" aria-labelledby=labelId
    aria-hidden="true")
  .modal-dialog
    .modal-content
      .modal-header
        button.close(type="button", data-dismiss="modal", aria-hidden="true") ×
        h4.modal-title(id=labelId) #{title}
      .modal-body
        p #{message}
      .modal-footer
        button.btn.btn-default.btn-primary(type="button", data-dismiss="modal") OK

messageModal.tpl.jade

extends ./layout.jade

0 个答案:

没有答案
相关问题