【问题标题】:jade extends and include not working together玉扩展并包括不一起工作
【发布时间】:2013-06-07 12:55:12
【问题描述】:

我遇到了一个问题,如果我在之后使用 includeextends,则包含文件中的块不会被使用。

//layout.jade
block content

//entry.jade
extends layout
case form
  when 'special'
    include special
  default
    include generic

//generic.jade/special.jade
block content
  Generic Content

当我这样做时,包含文件中的内容实际上并没有被使用。如果我将“扩展”放在包含的文件中,它可以工作,但我不想这样做。

我做错了什么还是不受支持?

【问题讨论】:

标签: pug


【解决方案1】:

好的。这里有几件事。

包含不是块,它只是代码。你可以找到整个include doc here

所以generic.jade/specific.jade应该只是玉码,不能是block content

你可能不得不在extends layout之后缩进case form

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-02-07
    • 2021-07-21
    • 2019-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-16
    • 1970-01-01
    相关资源
    最近更新 更多