const handleChange = ()=>{
// h5横竖屏切换的时候,这个宽度有时候拿到的还是之前的值
console.log(document.documentElement.clientWidth)
}
useEffect(() => {
screen.orientation.addEventListener('change', handleChange);
return () => {
screen.orientation.removeEventListener("change", handleChange)
}
}, [handleChange])