9

このようなヒスイの行の途中でミックスインを使用しようとしています...

p some paragraph text !{ 'this'+'works' } but !{ +myMixin() } breaks it!

しかし、うまくいきません。翡翠の行の途中で mixin を参照する方法がわかりません。出来ますか?

4

2 に答える 2

2

そのような文に 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>
于 2014-09-01T19:56:54.237 に答える