Alan
Alan

Reputation: 46813

Combining Jade Mixin output with the preceding tag in a template

say my jade template looks something like this:

mixin foo(bar)
 .fizzle=bar

#baz.mixin foo('beef') //this isn't the right way

I'd like the resultant output to be:

<div id='baz' class='fizzle'>beef</div>

What is the proper way to combine the output of the mixin with the current tag?

Upvotes: 1

Views: 280

Answers (1)

Jason
Jason

Reputation: 21

I'm afraid you cannot do like that. Or you can try like follows:

mixin foo(bar)
 #baz.fizzle= bar

mixin foo('beef')

or

mixin foo(bar)
  | #{bar}

#baz.fizzle
  mixin foo('beef')

Upvotes: 2

Related Questions