Skip to content
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

fix(mp-kuaishou): 快手小程序 修复 getuserextendinfo 事件无法触发的Bug (#4838) #4842

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/uni-mp-kuaishou/__tests__/vOn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ describe('mp-kuaishou: transform v-on', () => {
`<button open-type="getPhoneNumber" bindgetphonenumber="__e" data-e-o="{{a}}"></button>`,
`(_ctx, _cache) => {
return { a: { 'getphonenumber': _o(_ctx.getInfo) } }
}`
)
})
test(`getuserextendinfo`, () => {
assert(
`<button open-type="getuserextendinfo" @getuserextendinfo="getInfo"></button>`,
`<button open-type="getuserextendinfo" bindgetuserextendinfo="__e" data-e-o="{{a}}"></button>`,
`(_ctx, _cache) => {
return { a: { 'getuserextendinfo': _o(_ctx.getInfo) } }
}`
)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/uni-mp-kuaishou/dist/uni.compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ var source = {
*/
const transformOn = uniCliShared.createTransformOn(uniMpCompiler.transformOn, {
match: (name, node, context) => {
if (name === 'getphonenumber')
if (name === 'getphonenumber' || name === 'getuserextendinfo')
return true;
if (name === 'input' && (node.tag === 'input' || node.tag === 'textarea')) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion packages/uni-mp-kuaishou/src/compiler/transforms/vOn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { transformOn as baseTransformOn } from '@dcloudio/uni-mp-compiler'
*/
export const transformOn = createTransformOn(baseTransformOn, {
match: (name, node, context) => {
if (name === 'getphonenumber') return true
if (name === 'getphonenumber' || name === 'getuserextendinfo') return true
if (name === 'input' && (node.tag === 'input' || node.tag === 'textarea')) {
return true
}
Expand Down