【问题标题】:What is the equivalent of yield in jade?玉的产量相当于多少?
【发布时间】:2015-06-17 16:40:23
【问题描述】:

在 Ruby/Sinatra/Haml 我会写:

%html{:lang => 'en'}
  %head
    %meta{:charset => 'utf-8'}
    %title= @title

  %body
    =yield

在 Node/Express/Jade 中会是什么样子?

【问题讨论】:

    标签: node.js express pug


    【解决方案1】:

    我找到了解决办法:

    html(lang="en")
      head
        meta(charset="utf-8")
        title= title
    
      body
        != body
    

    【讨论】:

    • 您是否将 layout.jade 文件与另一个文件(即 index.jade)一起使用?
    • 谢谢,@asev69。从示例中删除,因为这不是问题所在。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-06
    • 1970-01-01
    • 1970-01-01
    • 2014-07-27
    • 1970-01-01
    • 2016-10-31
    相关资源
    最近更新 更多