下面是mixin
mixin form(title, action)
legend title
form.form-horizontal(method='post', action=action)
label Name:
input(type='text',name=Name,id=Name)
呈现为
<legend>title</legend>
<form method="post" action="save" class="form-horizontal">
<label>Name:</label>
<input type="text"/>
</form>
现在,我将标签和字段提取到另一个mixin中。
mixin form(title, action)
legend title
form.form-horizontal(method='post', action=action)
mixin field(name)
label #{name}:
input(type='text',name=name,id=name)
并将其用作
mixin form("xxxx", "save")
mixin field('Name')
这会导致错误
>> Line 1209: Unexpected string
Warning: Jade failed to compile test.jade. Use --force to continue.
能否嵌套Mixin?如何使其作为第一输出进行渲染。
谢谢。