fix(index): 修复首页在已登录状态下,不能点击的问题

This commit is contained in:
2025-12-20 16:52:29 +08:00
parent 3556691b56
commit 973c8dddd0
7 changed files with 48 additions and 9 deletions

View File

@@ -145,7 +145,16 @@ class EventBus {
)
// 调用 defaultAsyncHandler仅当允许
await callDefaultAsyncHandler(event, null, domResult)
await callDefaultAsyncHandler(event, null, domResult ?? true)
// 如果不允许继续传播,则直接返回(根据 defaultPrevented 判断结果)
if (!allowContinuePropagation) {
return !event.defaultPrevented
}
// 否则继续走普通 EventBus 处理fallthrough
} else if (this.platform === 'h5') {
// 调用 defaultAsyncHandler仅当允许
await callDefaultAsyncHandler(event, null, true)
// 如果不允许继续传播,则直接返回(根据 defaultPrevented 判断结果)
if (!allowContinuePropagation) {
@@ -192,6 +201,10 @@ class EventBus {
await callDefaultAsyncHandler(event, handler, awaitedResult)
} catch (error) {
console.error(`EventBus ${eventName} error:`, error)
// 发现错误,默认调用 defaultAsyncHandler仅当允许
await callDefaultAsyncHandler(event, handler, true)
// 如果全局或该 handler 指定遇错停止传播,则停止
if (stopOnError || handler.options?.stopOnError) {
break