index.jsx 1015 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { render } from "solid-js/web";
  2. import { Router } from "solid-app-router";
  3. import Routers from "./router/index";
  4. import utils from "./utils/index"
  5. import "./assets/style/layout.css"
  6. import "./assets/style/base.css"
  7. window.onresize = function () {
  8. utils.screenSize()
  9. }
  10. // 兼容requestAnimFrame
  11. window.requestAnimFrame = (function () {
  12. return window.requestAnimationFrame ||
  13. window.webkitRequestAnimationFrame ||
  14. window.mozRequestAnimationFrame ||
  15. function (callback) {
  16. window.setTimeout(callback, 60000 / 60);
  17. };
  18. })();
  19. window.cancelrequestAnimFrame = (function () {
  20. return window.cancelAnimationFrame ||
  21. window.webkitCancelAnimationFrame ||
  22. window.mozCancelAnimationFrame ||
  23. function (ID) {
  24. window.clearTimeout(ID);
  25. };
  26. })();
  27. render(() => {
  28. // 初始化根字体
  29. utils.screenSize()
  30. return (
  31. <Router>
  32. <Routers />
  33. </Router>
  34. )
  35. }, document.getElementById("root"));