"添加前端模板和运行代码模块"

This commit is contained in:
Codex
2026-06-01 13:43:09 +08:00
parent 24045274ad
commit 8092c4b1f8
587 changed files with 99761 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import { createHashRouter } from 'react-router-dom';
import Home from '@/pages/Home';
import ExamplesPage from '@/pages/ExamplesPage';
import NotFound from '@/pages/NotFound';
/**
* Hash-based routing (createHashRouter).
* URLs look like `/#/…` and need no server rewrite rules.
*
* Why hash mode:
* - Works on any static host without extra server config
* - The fragment is not sent to the server
* - Handy for static sites and CDNs
*
* Add a route:
* {
* path: '/your-path',
* element: <YourComponent />,
* }
*/
export const router = createHashRouter([
{
path: '/',
element: <Home />,
},
{
path: '/examples',
element: <ExamplesPage />,
},
{
path: '*',
element: <NotFound />,
},
]);