Answer the question
In order to leave comments, you need to log in
How to implement such logic in vue without document.querySelector?
How to get rid of document.querySelector, which everyone swears about in vue, but at the same time so that the logic is preserved?
Here is the code
https://codepen.io/Crot/pen/wvMmjZm
Answer the question
In order to leave comments, you need to log in
Add styles:
.child.red {
background: red;
}
@click="n.em = !n.em"
. :class="{ red: n.em }"
.
Correctly swear. Make a control that changes the state of the isOn variable further in the style, use a conditional operator, it is in the documentation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question