Skip to content

Let's use AI to Earn!

fix: 布局样式更改,修复了顶部导航栏会被滚动的问题

gaoSir95d8ddca8ddd
diff --git a/src/layout/LayoutBody.tsx b/src/layout/LayoutBody.tsx
index 11ecc414..2ea42d81 100644
--- a/src/layout/LayoutBody.tsx
+++ b/src/layout/LayoutBody.tsx
@@ -2,6 +2,7 @@ import { useUserStore } from '@/store/user';
import { useEffect } from 'react';
import { Navigate, Outlet } from 'react-router-dom';
import Navigation from './Navigation';
+import styles from "./layoutBody.module.scss";
export const LayoutBody = () => {
const userStore = useUserStore();
@@ -33,9 +34,9 @@ export const LayoutBody = () => {
}
return (
- <div className="flex flex-col h-full" style={{ height: '100%' }}>
+ <div className={styles.layoutBody}>
<Navigation />
- <main style={{ height: '100%', minHeight: 0, width: '100%' }}>
+ <main className="layoutBody-main">
<Outlet />
</main>
</div>
diff --git a/src/layout/Navigation/navigation.module.scss b/src/layout/Navigation/navigation.module.scss
index b6abc48e..d667f8b2 100644
--- a/src/layout/Navigation/navigation.module.scss
+++ b/src/layout/Navigation/navigation.module.scss
@@ -3,6 +3,7 @@
display: flex;
justify-content: space-between;
align-items: center;
+ flex-shrink: 0;
padding: 0 15px;
:global {
diff --git a/src/layout/layoutBody.module.scss b/src/layout/layoutBody.module.scss
new file mode 100644
index 00000000..81e61211
--- /dev/null
+++ b/src/layout/layoutBody.module.scss
@@ -0,0 +1,13 @@
+.layoutBody {
+ display: flex;
+ flex-direction: column;
+ height: 100vh;
+ :global {
+
+ .layoutBody-main {
+ height: 100%;
+ overflow: auto;
+ box-sizing: border-box;
+ }
+ }
+}
\ No newline at end of file