30 lines
754 B
TypeScript
30 lines
754 B
TypeScript
|
|
import { Suspense } from 'react';
|
|||
|
|
import styles from './App.module.less';
|
|||
|
|
import { useRoutes } from 'react-router-dom';
|
|||
|
|
import routes from './routes';
|
|||
|
|
import LoadingPage from './pages/loading';
|
|||
|
|
import FloatingButton from './compenents/floating-button';
|
|||
|
|
|
|||
|
|
// 在应用的入口文件(如 index.js 或 App.js)顶部添加
|
|||
|
|
|
|||
|
|
function App() {
|
|||
|
|
const originalWarn = console.warn;
|
|||
|
|
console.warn = (...args) => {
|
|||
|
|
if (!args[0] || !args[0].includes('Space.Compact is deprecated')) {
|
|||
|
|
originalWarn(...args);
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
const Views = () => useRoutes(routes);
|
|||
|
|
|
|||
|
|
return (
|
|||
|
|
<Suspense fallback={<LoadingPage />}>
|
|||
|
|
<div className={styles.App}>
|
|||
|
|
<Views />
|
|||
|
|
<FloatingButton />
|
|||
|
|
</div>
|
|||
|
|
</Suspense>
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export default App;
|