Article From:

I know it should be written in mounted.


But how should the original be realized?

Answer 0:

Do you all ignore a CSS attribute?
Direct setting:


As for vh:100vh, it is equal to the height of the current window, and the same is VW.

Answer 1:

This has nothing to do with the Vue framework. It’s CSS’s problem.

        <div class="app"></div>
    html,body {
        width: 100%;
        height: 100%;

Answer 2:

cssLi, HTML, body{height:100%}

 var doc = document.documentElement; =  doc.scrollHeight+'px';

Answer 3:

jsGet the window size:
document.documentElement.clientWidth ==> Visible area width
The same height.
Then you call it in created or mounted method.

Leave a Reply

Your email address will not be published. Required fields are marked *