【问题标题】:How do I evaluate a helper in Jade without outputting its result?如何在 Jade 中评估助手而不输出其结果?
【发布时间】:2011-04-05 20:32:21
【问题描述】:

我有一个 Jade 模板需要调用帮助程序,但不显示其输出:

// views/foo.html.jade:
p
  Some content...
#{ someHelperSetterMethod('bar'); }

不幸的是,由于someHelperSetterMethod 没有返回任何内容,我在模板中得到“未定义”输出。有没有办法进行非输出评估?

【问题讨论】:

    标签: node.js pug


    【解决方案1】:
    p
      some content
    - someHelperSetterMethod('bar')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-17
      • 1970-01-01
      相关资源
      最近更新 更多