Skip to content

Commit

Permalink
fix(mp-kuaishou): 快手小程序 修复 getuserextendinfo 事件无法触发的Bug (dcloudio#4838)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjinxin613 committed Apr 15, 2024
1 parent 7ce802e commit ac64197
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions packages/uni-mp-kuaishou/__tests__/vOn.spec.ts
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
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
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

0 comments on commit ac64197

Please sign in to comment.