add
This commit is contained in:
parent
c5bb5179ee
commit
b6fdb53131
|
@ -27,7 +27,9 @@ export const CourseSyllabus: React.FC<CourseSyllabusProps> = ({
|
||||||
onToggle,
|
onToggle,
|
||||||
}) => {
|
}) => {
|
||||||
const { isHeaderVisible } = useContext(CourseDetailContext);
|
const { isHeaderVisible } = useContext(CourseDetailContext);
|
||||||
const [expandedSections, setExpandedSections] = useState<string[]>([]);
|
const [expandedSections, setExpandedSections] = useState<string[]>(
|
||||||
|
sections.map((section) => section.id) // 默认展开所有章节
|
||||||
|
);
|
||||||
const sectionRefs = useRef<{ [key: string]: HTMLDivElement | null }>({});
|
const sectionRefs = useRef<{ [key: string]: HTMLDivElement | null }>({});
|
||||||
|
|
||||||
const toggleSection = (sectionId: string) => {
|
const toggleSection = (sectionId: string) => {
|
||||||
|
|
Loading…
Reference in New Issue