1 year ago

#371847

test-img

Andrey Freiz

When you add a dynamic style, it returns NaN although the class is prescribed and the variable returns true

I add a class like this :class="{[$style.header-hidden]: hideHeader}"

The function that is responsible for the variable

onScroll() {
    if (window.pageYOffset > 92) {
        this.hideHeader = true;
    }
},

It returns true, but the class returns NaN enter image description here

javascript

vue.js

css-modules

0 Answers

Your Answer

Accepted video resources