mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-09-11 03:03:34 +08:00
部门报错优化
This commit is contained in:
parent
7f4a08f7a4
commit
d9d3be1434
@ -30,6 +30,7 @@ export const Header: React.FC = () => {
|
|||||||
const [currentNav, serCurrentNav] = useState(location.pathname);
|
const [currentNav, serCurrentNav] = useState(location.pathname);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (departments.length > 0) {
|
||||||
setCurrentDepartment(departments[0].name);
|
setCurrentDepartment(departments[0].name);
|
||||||
const arr: any = [
|
const arr: any = [
|
||||||
{
|
{
|
||||||
@ -47,6 +48,7 @@ export const Header: React.FC = () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
setDepartmentsMenu(arr);
|
setDepartmentsMenu(arr);
|
||||||
|
}
|
||||||
}, [departments]);
|
}, [departments]);
|
||||||
|
|
||||||
const onClick: MenuProps["onClick"] = ({ key }) => {
|
const onClick: MenuProps["onClick"] = ({ key }) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user