index.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport"
  7. content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no,viewport-fit=cover">
  8. <meta name="format-detection" content="telephone=no,email=no">
  9. <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
  10. <meta http-equiv="Pragma" content="no-cache" />
  11. <meta http-equiv="Expires" content="0" />
  12. <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  13. <title></title>
  14. </head>
  15. <body>
  16. <noscript>
  17. <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
  18. Please enable it to continue.</strong>
  19. </noscript>
  20. <div id="app"></div>
  21. <!-- built files will be auto injected -->
  22. </body>
  23. <script>
  24. // 事件监听
  25. document.addEventListener('DOMContentLoaded', resetRem)
  26. window.onresize = resetRem
  27. /**
  28. * [resetRem 重置Rem数值]
  29. */
  30. function resetRem () {
  31. let documentCtx = document.documentElement
  32. documentCtx.style.fontSize = documentCtx.clientWidth / 10 + 'px'
  33. }
  34. </script>
  35. </html>