Compile mixin to JS in JADE

风格不统一 提交于 2019-12-11 10:27:05

问题


When trying to compile this JADE mixin (from their official docs)

mixin pets(pets)
  ul.pets
    - each pet in pets
      li= pet

into JavaScript using jade --client --no-debug pets.jade I get this output, which, as far as I can tell, doesn't actually do anything:

function template(locals) {
    var buf = [];
    var jade_mixins = {};
    var jade_interp;




    ;return buf.join("");
}

Is this a bug in the JADE compiler or am I doing something wrong? I was expecting it to compile it into something like function pets(pets)...

I'm on JADE 1.3.1

来源:https://stackoverflow.com/questions/23040717/compile-mixin-to-js-in-jade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!