fix: bugs

This commit is contained in:
Kilu 2024-06-29 17:23:18 +08:00
parent d4c5180761
commit e5fd455e93

View File

@ -75,19 +75,20 @@ function OutlineItem({ view, level = 0, width }: { view: PublishViewInfo; width:
); );
}; };
const children = view.child_views || [];
return ( return (
<div className={'flex h-fit flex-col'}> <div className={'flex h-fit flex-col'}>
{renderItem(view)} {renderItem(view)}
<div <div
className={'flex transform flex-col gap-2 transition-all'} className={'flex transform flex-col gap-2 transition-all'}
style={{ style={{
height: isExpanded && view.child_views?.length ? 'auto' : 0, display: isExpanded ? 'block' : 'none',
opacity: isExpanded && view.child_views?.length ? 1 : 0,
}} }}
> >
{view.child_views {children
?.filter((view) => view.layout === ViewLayout.Document) .filter((view) => view.layout === ViewLayout.Document)
?.map((item, index) => ( .map((item, index) => (
<OutlineItem level={level + 1} width={width} key={index} view={item} /> <OutlineItem level={level + 1} width={width} key={index} view={item} />
))} ))}
</div> </div>