S
S
SP2021-04-07 11:54:22
Pug
SP, 2021-04-07 11:54:22

How to put a condition in pug?

fieldset.claim-field.relative
                        span.absolute.top-5.left-5.-ml-px.h-full.bg-gray-200(class='w-0.5' aria-hidden='true')
                        .field-item
                            label.text-sm.text-gray-500(for='claim') Your claim number
                            input.required.claim(name='claim' type='number')


A class (active) will be added to jq by clicking on .claim-field
How to set a condition if there is a class .active in .claim-field, then in label .text-gray-500 changes to .text-gray-800

*There will be such blocks 3, so that it does not conflict with other blocks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2021-04-07
@yarkov

PUG does not know about runtime. You can only fulfill the conditions at the compilation stage, but it’s definitely jQuery that doesn’t work here.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question