D
D
Daniel2021-02-18 22:18:35
Pug
Daniel, 2021-02-18 22:18:35

How to nest an element in a variable in PUG?

I want to write the svg icon code into a variable. How to do it?
I tried
-
const icon =
svg.svg-icon
path

In the examples, only properties are put into variables, nowhere is there an example of adding an element

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
inkShio, 2021-02-18
@TheCrossCarrier

v1

mixin svg
  svg.svg-icon
    path

+svg

v2
- var svg2 = '<svg class="svg-icon"><path></path></svg>';

!= svg2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question