Done setup template
This commit is contained in:
30
frontend/src/index.jsx
Normal file
30
frontend/src/index.jsx
Normal file
@ -0,0 +1,30 @@
|
||||
import Layout from '@pages/Layout'
|
||||
import { Route, Router } from '@solidjs/router'
|
||||
import { For, lazy } from 'solid-js'
|
||||
import { render } from 'solid-js/web'
|
||||
import App from './App'
|
||||
import './index.css'
|
||||
import { ROUTES } from './routes'
|
||||
|
||||
const root = document.getElementById('root')
|
||||
|
||||
render(
|
||||
() => (
|
||||
<Router root={App}>
|
||||
<Route path="/login" component={lazy(() => import('@pages/Login'))} />
|
||||
<Route path="/" component={Layout}>
|
||||
<For each={ROUTES}>
|
||||
{(route) => (
|
||||
<Route
|
||||
path={route.path}
|
||||
component={route.components}
|
||||
matchFilters={route.filter}
|
||||
/>
|
||||
)}
|
||||
</For>
|
||||
</Route>
|
||||
<Route path="*" component={lazy(() => import('@pages/NotFound'))} />
|
||||
</Router>
|
||||
),
|
||||
root,
|
||||
)
|
Reference in New Issue
Block a user