线上课新建无章节课时选择逻辑优化

This commit is contained in:
禺狨
2023-03-17 12:26:49 +08:00
parent 0460da6974
commit e2dba07641
3 changed files with 8 additions and 1 deletions

View File

@@ -89,7 +89,12 @@ export const UploadVideoSub = (props: PropsInterface) => {
};
//重置选中的key
useEffect(() => {
setCheckedList(props.defaultCheckedList);
const arr = [...props.defaultCheckedList];
setCheckedList(arr);
if (arr.length === 0) {
setIndeterminate(false);
setCheckAll(false);
}
}, [props.defaultCheckedList]);
// 加载列表