mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-09 11:39:31 +08:00
fix: 清理掉了所有warn,优化了在移动端侧边栏的逻辑问题
This commit is contained in:
@@ -48,8 +48,16 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
const handleMenuOutside = () => {
|
||||
if (isMobile.value) menuVisible.value = false
|
||||
const handleMenuOutside = (event) => {
|
||||
// 检查点击事件是否来自菜单按钮
|
||||
const menuBtn = document.querySelector('.menu-btn')
|
||||
if (menuBtn && (menuBtn === event.target || menuBtn.contains(event.target))) {
|
||||
return // 如果是菜单按钮的点击,不处理关闭
|
||||
}
|
||||
|
||||
if (isMobile.value) {
|
||||
menuVisible.value = false
|
||||
}
|
||||
}
|
||||
|
||||
return { menuVisible, hideMenu, handleMenuOutside }
|
||||
|
||||
Reference in New Issue
Block a user