index.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. * {
  34. margin: 0;
  35. padding: 0;
  36. }
  37. </style>
  38. </head>
  39. <body>
  40. <noscript>
  41. <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  42. </noscript>
  43. <script>
  44. const ua = window.navigator.userAgent
  45. const isIE = ua.indexOf('MSIE ') > -1 || ua.indexOf('Trident/') > -1
  46. // IE 兼容
  47. if (isIE) {
  48. // 覆写scrollTo
  49. if (!window.scrollTo) {
  50. window.scrollTo = function(option) {
  51. window.scrollLeft = option.left;
  52. window.scrollTop = option.top;
  53. };
  54. }
  55. if (!document.body.scrollTo) {
  56. Element.prototype.scrollTo = function(option) {
  57. this.scrollLeft = option.left;
  58. this.scrollTop = option.top;
  59. };
  60. }
  61. }
  62. </script>
  63. <div id="app"></div>
  64. <!-- built files will be auto injected -->
  65. </body>
  66. </html>