feat: init

This commit is contained in:
Simon
2025-09-29 16:33:15 +08:00
parent e8041e0582
commit 847620b5e8
98 changed files with 20166 additions and 0 deletions

30
pages/main.tsx Normal file
View File

@@ -0,0 +1,30 @@
// import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { Route, Router, Switch } from 'wouter'
import { useHashLocation } from 'wouter/use-hash-location'
import { default as PagesRouter } from './router.tsx'
import { default as TestPagesRouter } from './test-pages/router.tsx'
import './index.css'
let baseURL: string
// 如果是 localhost就用 /
// 如果是其他环境,阶段到 index.html
if (window.location.hostname === 'localhost') {
baseURL = '/'
} else {
baseURL = window.location.pathname.split('index.html')[0] + 'index.html'
}
createRoot(document.getElementById('root')!).render(
// <StrictMode>
<Router hook={useHashLocation}>
<Switch>
<Route path="/test-pages" component={TestPagesRouter} nest />
<Route path="/" component={PagesRouter} nest />
</Switch>
</Router>
// </StrictMode>
)