1.禁止页面滚动
1.函数
preventBackgroundScroll(e: React.WheelEvent<HTMLDivElement>){
const target = e.currentTarget
if ((e.deltaY < 0 && target.scrollTop <= 0) ||(e.deltaY > 0 && target.scrollHeight - target.clientHeight - target.scrollTop <= 0)) {
e.stopPropagation()
e.preventDefault()
}
2.调用
<div onWheel = {this.state.lodding ? this.preventBackgroundScroll : null}></div>