fix: sync program status updates
This commit is contained in:
1 parent
ed62d42a63
commit
38bcbfc697
4 files changed
+40
-5
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { Suspense, useEffect, useState } from 'react'
|
||||
import { Outlet, useNavigate, useLocation } from 'react-router-dom'
|
||||
import { Outlet, useNavigate, useLocation , useOutlet } from 'react-router-dom'
|
||||
import { Layout, Menu, Button, Typography } from 'antd'
|
||||
import {
|
||||
DashboardOutlined, VideoCameraOutlined, PlusOutlined, MonitorOutlined,
|
||||
@@ -35,6 +35,7 @@ export default function AdminLayout() {
|
||||
const [collapsed, setCollapsed] = useState(false)
|
||||
const navigate = useNavigate()
|
||||
const location = useLocation()
|
||||
const outlet = useOutlet()
|
||||
|
||||
const selectedKey = menuItems.find(
|
||||
item => location.pathname === item.key || (location.pathname === '/' && item.key === '/admin')
|
||||
@@ -78,9 +79,11 @@ export default function AdminLayout() {
|
||||
<Button type="text" icon={<LogoutOutlined />} onClick={handleLogout}>退出登录</Button>
|
||||
</Header>
|
||||
<Content style={{ padding: 40, overflow: 'auto' }}>
|
||||
<Outlet />
|
||||
<div className="admin-page-transition" key={location.pathname}>
|
||||
{outlet}
|
||||
</div>
|
||||
</Content>
|
||||
</Layout>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user