Skip to content

Commit c2dcd95

Browse files
committed
fix(mp-alipay): 支持捕获事件修饰符 .capture
1 parent 767d76b commit c2dcd95

File tree

1 file changed

+4
-2
lines changed
  • packages/uni-mp-alipay/src/compiler

1 file changed

+4
-2
lines changed

packages/uni-mp-alipay/src/compiler/event.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import { customizeEvent } from '@dcloudio/uni-shared'
33
import type { MiniProgramCompilerOptions } from '@dcloudio/uni-cli-shared'
44

55
export const event: MiniProgramCompilerOptions['event'] = {
6-
format(name, { isCatch, isComponent }) {
6+
format(name, { isCatch, isCapture, isComponent }) {
77
if (!isComponent && name === 'click') {
88
name = 'tap'
99
}
1010
name = eventMap[name] || name
11-
return `${isCatch ? 'catch' : 'on'}${capitalize(customizeEvent(name))}`
11+
return `${isCapture ? 'capture-' : ''}${
12+
isCatch ? 'catch' : 'on'
13+
}${capitalize(customizeEvent(name))}`
1214
},
1315
}
1416

0 commit comments

Comments
 (0)