Skip to content

fix(mp-alipay): 支持捕获事件修饰符 .capture (question/209386) #5470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

chouchouji
Copy link
Contributor

相关社区帖子和 github issue

close #4339

https://ask.dcloud.net.cn/question/209386

Copy link

Size report

Path Size
packages/size-check/dist/size-check.es.js 47.11 KB (0%)
packages/size-check/dist/style.css 2.82 KB (0%)
packages/uni-app/dist/uni-app.es.js 2.47 KB (0%)
packages/uni-h5-vue/dist/vue.runtime.esm.js 76.41 KB (0%)
packages/uni-mp-vue/dist/vue.runtime.esm.js 43.13 KB (0%)
packages/uni-mp-alipay/dist/uni.api.esm.js 14.69 KB (0%)
packages/uni-mp-alipay/dist/uni.mp.esm.js 7.99 KB (0%)
packages/uni-mp-baidu/dist/uni.api.esm.js 11.34 KB (0%)
packages/uni-mp-baidu/dist/uni.mp.esm.js 9.68 KB (0%)
packages/uni-mp-qq/dist/uni.api.esm.js 10.65 KB (0%)
packages/uni-mp-qq/dist/uni.mp.esm.js 7.6 KB (0%)
packages/uni-mp-toutiao/dist/uni.api.esm.js 10.53 KB (0%)
packages/uni-mp-toutiao/dist/uni.mp.esm.js 9.42 KB (0%)
packages/uni-mp-weixin/dist/uni.api.esm.js 11.66 KB (0%)
packages/uni-mp-weixin/dist/uni.mp.esm.js 7.94 KB (0%)
packages/uni-quickapp-webview/dist/uni.api.esm.js 10.6 KB (0%)
packages/uni-quickapp-webview/dist/uni.mp.esm.js 8.16 KB (0%)

@Otto-J Otto-J requested a review from Copilot May 19, 2025 08:06
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the .capture event modifier in the mp-alipay compiler. It introduces a new parameter, isCapture, in the event formatting function and adjusts the returned event string accordingly.

  • Added the isCapture parameter to the format function.
  • Updated the return string to prepend "capture-" when isCapture is true.

if (!isComponent && name === 'click') {
name = 'tap'
}
name = eventMap[name] || name
return `${isCatch ? 'catch' : 'on'}${capitalize(customizeEvent(name))}`
return `${isCapture ? 'capture-' : ''}${
Copy link
Preview

Copilot AI May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm that when both isCapture and isCatch are true, the resulting event name (e.g., 'capture-catch...') aligns with the intended behavior. Consider adding a comment to clarify the precedence of these modifiers if needed.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

支持小程序的捕获类型事件
1 participant