fix(index): 修复首页在已登录状态下,不能点击的问题
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user