index.html 2.0 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. <!-- 生产环境外配置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. </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>