index.html 2.0 KB

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