Vue gets body height

the vue sub-component is a pop-up box, which has a mask layer, but the mask layer can only cover the height of the screen, not the excess document height.

this.$el.clientHeight

if you use the above syntax in mouted, you can only get the screen height.
excuse me: how to find the body height after rendering after the background obtains the data

Oct.21,2021

you can try to hang id on body , and then use dom to get


document.body.offsetHeight


css fixed layout. You don't need js. If you can solve it with css, you can never use js


agree to the third floor. Wow, position:fixed. Set overflow:hidden to hide the excess. In this way, the elements in the mask can be easily centered up and down.

Menu