N
N
Nikolai2019-04-25 16:40:37
Pug
Nikolai, 2019-04-25 16:40:37

What are data and attributes for in pug?

Good afternoon!
How to work with this mixin entry

mixin header-top-line(data)
  .header-top-line&attributes(attributes)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Ganin, 2019-04-26
@dohera

A mixin is like a function in JS. data in this example is the first parameter of the function. Esgo can be called whatever you like. But *&attribute expects an object like in JS to make block attributes out of it.
https://pugjs.org/language/attributes.html#attributes
https://pugjs.org/language/mixins.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question