12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import { lazy } from "solid-js";
- import { render } from "solid-js/web";
- import { Router, useRoutes, hashIntegration } from "@solidjs/router";
- // import { Router } from "solid-app-router";
- // import Routers from "./router/index";
- const routes = [
- {
- path: "/",
- component: lazy(() => import("./pages/BigScreen/Home"))
- },
- {
- path: "/common",
- component: lazy(() => import("./pages/CommonBigScreen/Home"))
- }
- ];
- import utils from "./utils/index"
- import "./assets/style/layout.css"
- import "./assets/style/base.css"
- window.onresize = function () {
- utils.screenSize()
- }
- // 兼容requestAnimFrame
- window.requestAnimFrame = (function () {
- return window.requestAnimationFrame ||
- window.webkitRequestAnimationFrame ||
- window.mozRequestAnimationFrame ||
- function (callback) {
- window.setTimeout(callback, 60000 / 60);
- };
- })();
- window.cancelrequestAnimFrame = (function () {
- return window.cancelAnimationFrame ||
- window.webkitCancelAnimationFrame ||
- window.mozCancelAnimationFrame ||
- function (ID) {
- window.clearTimeout(ID);
- };
- })();
- render(() => {
- // 初始化根字体
- utils.screenSize()
- const Routes = useRoutes(routes);
- return (
- // <Router>
- // <Routers />
- // </Router>
- <Router source={hashIntegration()}>
- <Routes />
- </Router>
- )
- }, document.getElementById("root"));
|