解决方案
html {
overflow-y: scroll;
}
:root {
overflow-y: auto;
overflow-x: hidden;
}
:root body {
position: absolute;
}
body {
width: 100vw;
overflow: hidden;
}
tuax/tua-body-scroll-lock: 🔐 Body scroll locking that just works with everything (github.com)
overscroll-behavior - CSS: Cascading Style Sheets | MDN (mozilla.org)
相关参考
小tip:CSS vw让overflow:auto页面滚动条出现时不跳动 « 张鑫旭-鑫空间-鑫生活 (zhangxinxu.com)
浏览器滚动条导致的页面闪烁问题 - 掘金 (juejin.cn)