Answer the question
In order to leave comments, you need to log in
How to count the number of elements in VueJS?
There is a slider that works through a scroll, and for it to work adequately, I need to get all elements with the body__screen class, but, to my surprise, document.getElementsByClassName()
it just doesn’t work inside vue scripts!
I googled, googled, looked through the documentation and did not master it.
They suggested methods that simply do not work, or are suitable for a single element (the ref attribute).
How then to receive the necessary elements?
Answer the question
In order to leave comments, you need to log in
Why doesn't it work?) javascript hasn't gone anywhere, just like the browser api.
You can use querySelectorAll as well:document.querySelectorAll('.body__screen')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question