🐻 简化层级,减少DOM

This commit is contained in:
tangly1024
2021-09-29 14:59:27 +08:00
parent 791af3a1af
commit 5012d6d9a2
9 changed files with 42 additions and 79 deletions

View File

@@ -21,15 +21,9 @@ const Progress = ({ targetRef }) => {
return () => document.removeEventListener('scroll', scrollListener)
}, [percent])
return (
<>
{/* 顶部进度条 */}
<div className='h-1.5 fixed top-0 w-full shadow-2xl z-40'>
return (<div className='h-1.5 fixed top-0 w-full shadow-2xl z-40'>
<div className='h-1 bg-blue-500 fixed top-0 w-1 duration-200' style={{ width: `${percent}%` }}/>
{/* <div className='debug'>{percent}</div> */}
</div>
</>
)
</div>)
}
export default Progress