mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-07-19 00:09:42 +08:00
首页筛选框默认选中
This commit is contained in:
parent
d6d814deb7
commit
cf392c43c6
@ -20,6 +20,7 @@ const IndexPage = () => {
|
||||
const [categories, setCategories] = useState<any>([]);
|
||||
const [categoryId, setCategoryId] = useState<number>(0);
|
||||
const [categoryText, setCategoryText] = useState<string>("所有分类");
|
||||
const [selectKey, setSelectKey] = useState<any>([0]);
|
||||
const [learnCourseRecords, setLearnCourseRecords] = useState<any>({});
|
||||
const [learnCourseHourCount, setLearnCourseHourCount] = useState<any>({});
|
||||
const [stats, setStats] = useState<any>({});
|
||||
@ -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)}
|
||||
>
|
||||
<Tree
|
||||
selectedKeys={[0]}
|
||||
selectedKeys={selectKey}
|
||||
switcherIcon={null}
|
||||
onSelect={onSelect}
|
||||
treeData={categories}
|
||||
|
Loading…
x
Reference in New Issue
Block a user