feat: 本次提交更新内容如下

更了全局layout组件
This commit is contained in:
笔记本里的永平
2025-07-07 16:13:04 +08:00
parent 5ca8050fc5
commit 289947e68f
9 changed files with 529 additions and 441 deletions

View File

@@ -2,6 +2,9 @@ import React, { useEffect, useRef } from 'react';
import { useNavigate } from 'react-router-dom';
import { Bell, Smartphone, Users, Activity } from 'lucide-react';
import Chart from 'chart.js/auto';
import Layout from '@/components/Layout';
import BottomNav from '@/components/BottomNav';
import '@/components/Layout.css';
// 模拟数据
const stats = {
@@ -140,19 +143,20 @@ export default function Home() {
}, []);
return (
<div className="flex-1 flex flex-col bg-gray-50">
{/* 固定header */}
<header className="fixed top-0 left-0 right-0 z-20 bg-white border-b">
<div className="flex justify-between items-center p-4">
<h1 className="text-xl font-semibold text-blue-600"></h1>
<button className="p-2 hover:bg-gray-100 rounded-full">
<Bell className="h-5 w-5 text-gray-600" />
</button>
<Layout
header={
<div className="bg-white border-b">
<div className="flex justify-between items-center p-4">
<h1 className="text-xl font-semibold text-blue-600"></h1>
<button className="p-2 hover:bg-gray-100 rounded-full">
<Bell className="h-5 w-5 text-gray-600" />
</button>
</div>
</div>
</header>
{/* 可滚动的内容区域 */}
<div className="flex-1 overflow-y-auto pt-16 pb-24">
}
footer={<BottomNav />}
>
<div className="bg-gray-50">
<div className="p-4 space-y-6">
{/* 统计卡片 */}
<div className="grid grid-cols-3 gap-4">
@@ -234,6 +238,6 @@ export default function Home() {
</div>
</div>
</div>
</div>
</Layout>
);
}