Fixed layout and routing
This commit is contained in:
parent
c57727e20a
commit
ddff738d2e
5 changed files with 54 additions and 26 deletions
33
src/routers/router.tsx
Normal file
33
src/routers/router.tsx
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { lazy } from 'solid-js'
|
||||
import Layout from '../layouts/Layout.tsx'
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
component: (props: any) => <Layout>{props.children}</Layout>,
|
||||
children: [
|
||||
{
|
||||
path: '/',
|
||||
component: lazy(() => import('../pages/IndexPage/Index.tsx')),
|
||||
},
|
||||
{
|
||||
path: '/main',
|
||||
component: lazy(() => import('../pages/MainPage/Main.tsx')),
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
component: lazy(() => import('../pages/RegisterPage/Register.tsx')),
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: lazy(() => import('../pages/LoginPage/Login.tsx')),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '**',
|
||||
component: () => <div>404</div>,
|
||||
},
|
||||
]
|
||||
|
||||
export default routes
|
||||
Loading…
Add table
Add a link
Reference in a new issue