Created () { // set the root size // screen width setHTML (); // the addEventListener () does not conflict window.addEventListener ( ' a resize ' , setHTML, to true ); function setHTML () { // read the current screen width var = windowWidth document.documentElement.clientWidth; // to see how many times the 600 var Rate = windowWidth / 600 ; // how many times the 600 we should let the root HTML font size is set to 60, how many times (this figure is my own series a) document.documentElement.style.fontSize = 60 * Rate + ' PX ' ; } } }
Like my little partner can focus on micro-channel public number "front-end pseudo-uncle."