我尝试在jade代码的中间使用mixin,像这样...p some paragraph text !{ 'this'+'works' } but !{ +myMixin() } breaks it! 但是它不起作用。我无法弄清楚如何在jade的一行中引用一个mixin。这是否可能?
这样的句子中无法放置mixin(混入)。 你可以在mixin内部包含块,并使用竖杠 |表示纯文本。 mixin myMixin() strong block p This is a sentence +myMixin() | with bold text | and this is the rest of it 这将呈现: <p>This is a sentence <strong>with bold text</strong> and this is the rest of it</p>