We all know that adaptation to the front-end PC version is a challenge, most of which are media queries. However, if you have time for companies to do not want to perform media queries, the screen is displayed on full screen regardless of the size of the screen. I am thinking about why I don't need REM to adapt to the PC.
I made a simple JS adaptation based on the design diagram 1920.
<SCRIPT type = "text/JavaScript"> var winwidth = document.doc umentelement. offsetwidth | document. Body. offsetwidth winwidth = winwidth <1366? 1366: winwidth var ohtml = document. getelementsbytagname ('html') [0] ohtml. style. fontsize = 100 * winwidth/1920 + 'px 'window. addeventlistener ('resize', function () {var winwidth = document.doc umentelement. offsetwidth | document. body. offsetwidth winwidth = winwidth <1400? 1400: winwidth var ohtml = Document. getelementsbytagname ('html') [0] ohtml. style. fontsize = 100 * winwidth/1920 + 'px '}) </SCRIPT>
Put this JS script in the root directory, which is also included in index.html. The size we have measured is divided by 100 to convert the bit REM.
By the way, my project is built by vue. Of course, if it is a vue-cli3, It will be placed in the index file under the Public file.
This completes simple PC-end adaptation.
Simple adaptation of front-end PC Edition