在玉

2013-11-04 51 views
6

我試圖在一條線上的玉像這樣的中間使用一個混合用途混入直列...在玉

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

但它不工作。我無法弄清楚如何在一行玉石中間引用一個mixin。可能嗎?

+4

恐怕你不能做到這一點的翡翠混入是塊組件,因此需要像任何其他塊一樣對待,例如p,div等 – Tom

回答

2

將mixin放入這樣的句子是不可能的。 你可以做的是在mixin中包含blocks,並使用純文本的pikes |

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> 
13

您需要使用玉混入內嵌特殊的方式:

p. 
    Hello I'm using #[+jadeMixin(param)] inline. 
+2

這應該被標記爲正確的答案。 –