提交 b2f0d426 编写于 作者: D DCloud_LXH

fix(mp-kuaishou): getphonenumber callback question/143078

上级 aeb6f52a
......@@ -39,15 +39,26 @@ describe('mp-kuaishou: transform v-on', () => {
return { a: _j({ 'click': _o(_ctx.click) }) }
}`
)
}),
test(`multi custom event`, () => {
assert(
`<custom @unmount="unmount" @custom-mount="mount();created();"/>`,
`<custom bindunmount="__e" bindcustomMount="__e" u-i="2a9ec0b0-0" bind:__l="__l" eO="{{a}}"/>`,
`(_ctx, _cache) => {
})
test(`multi custom event`, () => {
assert(
`<custom @unmount="unmount" @custom-mount="mount();created();"/>`,
`<custom bindunmount="__e" bindcustomMount="__e" u-i="2a9ec0b0-0" bind:__l="__l" eO="{{a}}"/>`,
`(_ctx, _cache) => {
return { a: _j({ 'unmount': _o(_ctx.unmount), 'customMount': _o($event => { _ctx.mount(); _ctx.created(); }) }) }
}`
)
})
)
})
})
describe('event', () => {
test(`getphonenumber`, () => {
assert(
`<button open-type="getPhoneNumber" @getphonenumber="getInfo"></button>`,
`<button open-type="getPhoneNumber" bindgetphonenumber="__e" data-e-o="{{a}}"></button>`,
`(_ctx, _cache) => {
return { a: { 'getphonenumber': _o(_ctx.getInfo) } }
}`
)
})
})
})
......@@ -5,6 +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 === 'input' && (node.tag === 'input' || node.tag === 'textarea')) {
return true
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册