This commit is contained in:
caishi 2020-12-16 11:37:56 +08:00
parent 2129a222e5
commit 45fc4dcdcd
1 changed files with 2 additions and 1 deletions

View File

@ -44,11 +44,12 @@ export default ({
useEffect(()=>{
if(url && url.hash && html){
let u = url.hash;
debugger;
if(u){
let id = decodeURIComponent(u.split("#")[1]);
let ele = document.getElementById(id);
if(ele){
window.scrollTo(0, ele.offsetTop - window.innerHeight / 5);
window.scrollTo(0, ele.offsetTop + 220);
}
}
}