Answer the question
In order to leave comments, you need to log in
How to call the required block using parameters and if else in the pug(jade) mixin?
There is a hexagons and text block, and depending on what is here - var item = "hexagons" that will be displayed. But in this case, if you display the mixin once, if you output the second time, it will be the same story. How to call the required block using parameters and if else in the pug(jade) mixin? Those. write +commonBlock('parameter') to use one mixin but in the first case I want to call hexagons and in the second text. Or maybe it can be done in some other way in a more elegant way?
mixin commonBlock()
section#section-01
.container
.row
.col-md-12
h2 What can you receive?
p
| Daisy is sagittis sem nibh id elit. Duis sed odio sit amet nibh vulputate cursus a sit amet mauris. Morbi accumsan ipsum velit. Nam nec tellus a odio tincidunt auctor a ornare odio. Sed non mauris vitae erat consequat auctor eu in elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris in erat justo. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim.
- var item = "hexagons"
if item == "hexagons"
.row
.col-md-12
.items
.col-md-3
.item 1
.col-md-3
.item 2
.col-md-3
.item 3
.col-md-3
.item 4
else if item == "text"
.row
.col-md-12
p Текст
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question