Prevent scroll when QuickAccess overlay is open (#381)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: jxxghp <jxxghp@live.cn>
This commit is contained in:
jxxghp
2025-08-25 22:46:28 +08:00
committed by GitHub
parent 63b108ff6b
commit 97f3435bb3

View File

@@ -212,6 +212,11 @@ watch(
if (visible) {
fetchPluginsWithPage()
loadRecentPlugins()
// 添加v-overlay-scroll-blocked类到html元素
document.documentElement.classList.add('v-overlay-scroll-blocked')
} else {
// 移除v-overlay-scroll-blocked类
document.documentElement.classList.remove('v-overlay-scroll-blocked')
}
},
{ immediate: true },
@@ -224,6 +229,11 @@ onMounted(() => {
}
})
// 组件卸载时确保移除v-overlay-scroll-blocked类
onUnmounted(() => {
document.documentElement.classList.remove('v-overlay-scroll-blocked')
})
// 处理触摸开始
function handleTouchStart(event: TouchEvent) {
if (!props.visible) return