Skip to content

Commit

Permalink
fix: 修复 vite 热更新失效的问题,改匿名箭头函数组件为 default function 加名字再导出
Browse files Browse the repository at this point in the history
  • Loading branch information
kangood committed Feb 18, 2024
1 parent 22a8568 commit 7a1dfb9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/pages/home/list.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Column } from '@antv/g2plot';
import { Avatar, Button, Divider, Tabs, TabsProps } from 'antd';
import { useEffect, useRef } from 'react';

import Card from '@/components/card';

const data = [
{
name: '您',
Expand Down Expand Up @@ -95,7 +97,7 @@ const data = [
},
];

export default () => {
export default function Home() {
const ref = useRef(null);
// 图表。保证首次加载,且只加载一次
useEffect(() => {
Expand Down Expand Up @@ -229,13 +231,17 @@ export default () => {
</section>
<section className="mt-3 flex ">
<div className="bg-white dark:bg-slate-900 mr-3 w-1/2">
<div className="m-5 font-bold text-[#487ec1]">近八天系统访问记录</div>
<div className="ml-5" ref={ref} />
<Card>
<div className="m-5 font-bold text-[#487ec1]">近八天系统访问记录</div>
<div className="ml-5" ref={ref} />
</Card>
</div>
<div className="bg-white dark:bg-slate-900 w-1/2 pl-3">
<Tabs defaultActiveKey="1" items={items} />
<Card>
<Tabs defaultActiveKey="1" items={items} />
</Card>
</div>
</section>
</div>
);
};
}

0 comments on commit 7a1dfb9

Please sign in to comment.