创建玉石混合时,例如:
mixin form()
form(
id=attributes.id,
class=attributes.class
)
block
然后像这样延伸:
mixin form-horizontal()
+form.form-horizontal(
id=attributes.id,
class=attributes.class
)
block
如何将属性从继承的mixin传递给基础mixin,以便您可以编写它?
mixin form-horizontal()
+form.form-horizontal
block
答案 0 :(得分:2)
您传递属性变量:
mixin form()
form(attributes)
block
mixin form-horizonal()
form.form-horizontal(attributes=attributes)
block