Newer
Older
smartwell_front / src / views / zhangqiu / index.html
liuyangyingjie on 16 Aug 2022 1 KB feat(view): 新增章丘驾驶舱看板
<!DOCTYPE html>
<html lang="">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title><%= htmlWebpackPlugin.options.title %></title>
    <script>
      var width = document.documentElement.clientWidth || document.body.clientWidth;
      if(width<=1200){
        width=1200
      }
      var ratio = width / 1920;
      var fontSize = 100 * ratio;
      console.log(fontSize);
      document.getElementsByTagName('html')[0].style['font-size'] = fontSize + 'px';
      window.addEventListener('resize', function() {
    // 变化后需要做的事
    var width = document.documentElement.clientWidth || document.body.clientWidth;
    console.log(width,width<1000);
      if(width<=1200){

        width=1200
      }
      console.log(width,width<1200);
      var ratio = width / 1920;
      var fontSize = 100 * ratio;
      // console.log(fontSize);
      document.getElementsByTagName('html')[0].style['font-size'] = fontSize + 'px';

})
    </script>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>