From e5e55a34c2788e4e10c22265703ead283655e064 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Fri, 24 Jun 2022 18:28:07 +0800 Subject: [PATCH] fix(mp-weixin): dynamic input type (iOS) (question/147787) --- .../uni-mp-weixin/__tests__/component.spec.ts | 23 +++++++++++++++++++ .../uni-mp-weixin/src/compiler/options.ts | 1 + 2 files changed, 24 insertions(+) diff --git a/packages/uni-mp-weixin/__tests__/component.spec.ts b/packages/uni-mp-weixin/__tests__/component.spec.ts index 95c641b33..50c613f3f 100644 --- a/packages/uni-mp-weixin/__tests__/component.spec.ts +++ b/packages/uni-mp-weixin/__tests__/component.spec.ts @@ -26,6 +26,29 @@ describe('mp-weixin: transform component', () => { code, `(_ctx, _cache) => { return {} +}` + ) + }) + test('lazy element: input', () => { + assert( + ``, + ``, + `(_ctx, _cache) => { + return {} +}` + ) + assert( + ``, + ``, + `(_ctx, _cache) => { + return {} +}` + ) + assert( + ``, + ``, + `(_ctx, _cache) => { + return { a: _ctx.type } }` ) }) diff --git a/packages/uni-mp-weixin/src/compiler/options.ts b/packages/uni-mp-weixin/src/compiler/options.ts index bba1b5804..06e45436b 100644 --- a/packages/uni-mp-weixin/src/compiler/options.ts +++ b/packages/uni-mp-weixin/src/compiler/options.ts @@ -53,6 +53,7 @@ export const miniProgram: MiniProgramCompilerOptions = { }, ], // iOS 平台需要延迟 + input: [{ name: 'bind', arg: ['type'] }], textarea: [{ name: 'on', arg: ['input'] }], }, component: { -- GitLab