【发布时间】:2011-12-13 13:56:59
【问题描述】:
我正在为 node.js 使用玉。我有 1 个 mixin(测试):
mixin some( field, field2 )
.field!= field
.field2!= field2
我需要在mixin中加入一些html代码,例如:
#test
some( a( href='http://test' )='test', span.description=description )
我想要那个:
<div id="test">
<div class="field"><a href="http://test">test</a></div>
<div class="field2"><span class="description">bla bla bla</span></div>
</div>
我该怎么做?现在我只知道一个丑陋的决定:
#test
- var field = '<a href="http://test">test</a>';
- var field2 = '<span class="description">' + descriptions + '</span>';
mixin some( field, field2 )
对不起,我的英语不好:)
【问题讨论】: