index.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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>
  9. <%= htmlWebpackPlugin.options.title %>
  10. </title>
  11. <script>
  12. (function () {
  13. // 按Ctrl+Shift+U,放开U,在一秒内再按Ctrl+Shift+P,可以调出开发者工具
  14. let firstStepKey = false;
  15. document.addEventListener("keydown", function (e) {
  16. if (e.ctrlKey && e.shiftKey && e.code === "KeyU") {
  17. firstStepKey = true;
  18. setTimeout(() => {
  19. firstStepKey = false;
  20. }, 1000);
  21. }
  22. if (firstStepKey && e.ctrlKey && e.shiftKey && e.code === "KeyP") {
  23. window.require("electron")
  24. .remote.getCurrentWindow()
  25. .toggleDevTools();
  26. }
  27. });
  28. })();
  29. </script>
  30. </head>
  31. <body>
  32. <noscript>
  33. <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
  34. properly without JavaScript enabled. Please enable it to
  35. continue.</strong>
  36. </noscript>
  37. <div id="app"></div>
  38. <!-- built files will be auto injected -->
  39. </body>
  40. </html>