feat: update
This commit is contained in:
@@ -1,37 +1,40 @@
|
||||
import type { RouteObject } from 'react-router-dom'
|
||||
/** @format */
|
||||
|
||||
import NoFound from '@/views/404/404'
|
||||
import Login from './modules/login/index.ts'
|
||||
import Register from './modules/register/index.ts'
|
||||
import home from './modules/home/index.ts'
|
||||
import Main from './modules/main/index.ts'
|
||||
import type { RouteObject } from "react-router-dom";
|
||||
|
||||
import NoFound from "@/views/404/404";
|
||||
import Login from "./modules/login/index.ts";
|
||||
import Register from "./modules/register/index.ts";
|
||||
import home from "./modules/home/index.ts";
|
||||
import Main from "./modules/main/index.ts";
|
||||
|
||||
import ComponentLoading from "@/components/ComponentLoading";
|
||||
|
||||
import ComponentLoading from '@/components/ComponentLoading'
|
||||
const routes: RouteObject[] = [
|
||||
{
|
||||
path: '/',
|
||||
Component: (props) => ComponentLoading(home, props),
|
||||
},
|
||||
{
|
||||
path: '*',
|
||||
Component: NoFound,
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
Component: (props) => ComponentLoading(Register, props),
|
||||
},
|
||||
// {
|
||||
// path: '/home',
|
||||
// Component: home,
|
||||
// },
|
||||
{
|
||||
path: '/login',
|
||||
Component: (props) => ComponentLoading(Login, props),
|
||||
},
|
||||
{
|
||||
path: '/main',
|
||||
Component: (props) => ComponentLoading(Main, props),
|
||||
},
|
||||
]
|
||||
{
|
||||
path: "/",
|
||||
Component: (props) => ComponentLoading(home, props),
|
||||
},
|
||||
{
|
||||
path: "*",
|
||||
Component: NoFound,
|
||||
},
|
||||
{
|
||||
path: "/register",
|
||||
Component: (props) => ComponentLoading(Register, props),
|
||||
},
|
||||
// {
|
||||
// path: '/home',
|
||||
// Component: home,
|
||||
// },
|
||||
{
|
||||
path: "/login",
|
||||
Component: (props) => ComponentLoading(Login, props),
|
||||
},
|
||||
{
|
||||
path: "/main",
|
||||
Component: (props) => ComponentLoading(Main, props),
|
||||
},
|
||||
];
|
||||
|
||||
export default routes
|
||||
export default routes;
|
||||
|
@@ -1,9 +1,11 @@
|
||||
import { lazy } from 'react'
|
||||
/** @format */
|
||||
|
||||
import { lazy } from "react";
|
||||
|
||||
const home = lazy(
|
||||
() =>
|
||||
new Promise((resolve: any) => {
|
||||
setTimeout(() => resolve(import('@/views/Home/')), 1000)
|
||||
}),
|
||||
)
|
||||
export default home
|
||||
() =>
|
||||
new Promise((resolve: any) => {
|
||||
setTimeout(() => resolve(import("@/views/Home/")), 1000);
|
||||
}),
|
||||
);
|
||||
export default home;
|
||||
|
Reference in New Issue
Block a user