M
M
MeMoJlor2021-10-02 21:33:01
Vue.js
MeMoJlor, 2021-10-02 21:33:01

How to get a class, if one of the two values ​​is true?

There is a logoBlack class, you need to make sure that it is activated when one of the following values ​​is true: changecolor, openedMenu. Do I need to use the ternary operator?
:class='{logoBlack: changeColor, openedMenu}'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2021-10-02
@MeMoJlor

OR
:class='{logoBlack: changeColor || openedMenu}'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question