index.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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" content="width=device-width,initial-scale=1.0">
  7. <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  8. <title><%= htmlWebpackPlugin.options.title %></title>
  9. <style>
  10. /* 滚动条样式 */
  11. ::-webkit-scrollbar {
  12. -webkit-appearance: none;
  13. width: 6px;
  14. height: 6px;
  15. }
  16. /* 滚动条内的轨道 */
  17. ::-webkit-scrollbar-track {
  18. background: rgba(0, 0, 0, 0.1);
  19. border-radius: 0;
  20. }
  21. /* 滚动条内的滑块 */
  22. ::-webkit-scrollbar-thumb {
  23. cursor: pointer;
  24. border-radius: 5px;
  25. background: rgba(0, 0, 0, 0.15);
  26. transition: color 0.2s ease;
  27. }
  28. html, body {
  29. height: 100vh;
  30. /* overflow-y: auto */
  31. overflow: hidden !important;
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <noscript>
  37. <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  38. </noscript>
  39. <script>
  40. const ua = window.navigator.userAgent
  41. const isIE = ua.indexOf('MSIE ') > -1 || ua.indexOf('Trident/') > -1
  42. // IE 兼容
  43. if (isIE) {
  44. // 覆写scrollTo
  45. if (!window.scrollTo) {
  46. window.scrollTo = function(option) {
  47. window.scrollLeft = option.left;
  48. window.scrollTop = option.top;
  49. };
  50. }
  51. if (!document.body.scrollTo) {
  52. Element.prototype.scrollTo = function(option) {
  53. this.scrollLeft = option.left;
  54. this.scrollTop = option.top;
  55. };
  56. }
  57. }
  58. </script>
  59. <div id="app"></div>
  60. <!-- built files will be auto injected -->
  61. </body>
  62. </html>