diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index bce560f..c8d3eec 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -20,6 +20,7 @@ const IndexPage = () => { const [categories, setCategories] = useState([]); const [categoryId, setCategoryId] = useState(0); const [categoryText, setCategoryText] = useState("所有分类"); + const [selectKey, setSelectKey] = useState([0]); const [learnCourseRecords, setLearnCourseRecords] = useState({}); const [learnCourseHourCount, setLearnCourseHourCount] = useState({}); const [stats, setStats] = useState({}); @@ -167,6 +168,7 @@ const IndexPage = () => { const onSelect = (selectedKeys: any, info: any) => { setCategoryId(selectedKeys[0]); setCategoryText(info.node.title); + setSelectKey(selectedKeys); hide(); }; @@ -185,7 +187,7 @@ const IndexPage = () => { onMouseOver={() => setOpen(true)} >