mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
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:
co-authored by
Cursor Agent
jxxghp
parent
63b108ff6b
commit
97f3435bb3
@@ -212,6 +212,11 @@ watch(
|
|||||||
if (visible) {
|
if (visible) {
|
||||||
fetchPluginsWithPage()
|
fetchPluginsWithPage()
|
||||||
loadRecentPlugins()
|
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 },
|
{ immediate: true },
|
||||||
@@ -224,6 +229,11 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 组件卸载时确保移除v-overlay-scroll-blocked类
|
||||||
|
onUnmounted(() => {
|
||||||
|
document.documentElement.classList.remove('v-overlay-scroll-blocked')
|
||||||
|
})
|
||||||
|
|
||||||
// 处理触摸开始
|
// 处理触摸开始
|
||||||
function handleTouchStart(event: TouchEvent) {
|
function handleTouchStart(event: TouchEvent) {
|
||||||
if (!props.visible) return
|
if (!props.visible) return
|
||||||
|
|||||||
Reference in New Issue
Block a user