From 027e8d65afa6f96c51a27270ed02b7df8e05999b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E5=88=9A?= Date: Mon, 12 Jul 2021 17:09:26 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix(jd):=20=E4=BF=AE=E5=A4=8D=E4=BA=AC?= =?UTF-8?q?=E4=B8=9C=E5=B0=8F=E7=A8=8B=E5=BA=8FonLongPress=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-jd/src/template.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/taro-jd/src/template.ts b/packages/taro-jd/src/template.ts index 98ce2074fc2d..14e96d3e7d93 100644 --- a/packages/taro-jd/src/template.ts +++ b/packages/taro-jd/src/template.ts @@ -13,9 +13,12 @@ export class Template extends UnRecursiveTemplate { type: 'jd' } - replacePropName (name, value) { - if (name === 'bingdlongtap') return 'bindlongpress' - if (value === 'eh') return name.toLowerCase() + replacePropName (name, value, componentName) { + if (value === 'eh') { + const nameLowerCase = name.toLowerCase() + if (nameLowerCase === 'bindlongtap' && componentName !== 'canvas') return 'bindlongpress' + return nameLowerCase + } return name } } From e3032e3eb81a4b8973dd3dc02dd9c4dc26917e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E5=88=9A?= Date: Mon, 12 Jul 2021 17:19:09 +0800 Subject: [PATCH 2/6] =?UTF-8?q?Revert=20"fix(jd):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=B0=8F=E7=A8=8B=E5=BA=8FonLongPress?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A4=B1=E6=95=88"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 027e8d65afa6f96c51a27270ed02b7df8e05999b. --- packages/taro-jd/src/template.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/taro-jd/src/template.ts b/packages/taro-jd/src/template.ts index 14e96d3e7d93..98ce2074fc2d 100644 --- a/packages/taro-jd/src/template.ts +++ b/packages/taro-jd/src/template.ts @@ -13,12 +13,9 @@ export class Template extends UnRecursiveTemplate { type: 'jd' } - replacePropName (name, value, componentName) { - if (value === 'eh') { - const nameLowerCase = name.toLowerCase() - if (nameLowerCase === 'bindlongtap' && componentName !== 'canvas') return 'bindlongpress' - return nameLowerCase - } + replacePropName (name, value) { + if (name === 'bingdlongtap') return 'bindlongpress' + if (value === 'eh') return name.toLowerCase() return name } } From fa8c98b862a2abb62384bf41075cf84e8c1aecb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E5=88=9A?= Date: Mon, 12 Jul 2021 17:19:20 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix(jd):=20=E4=BF=AE=E5=A4=8D=E4=BA=AC?= =?UTF-8?q?=E4=B8=9C=E5=B0=8F=E7=A8=8B=E5=BA=8FonLongPress=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-jd/types/template.d.ts | 2 +- .../__tests__/__snapshots__/jd.spec.ts.snap | 120 +++++++++--------- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/packages/taro-jd/types/template.d.ts b/packages/taro-jd/types/template.d.ts index 19dd21039f01..62c8545dd4a7 100644 --- a/packages/taro-jd/types/template.d.ts +++ b/packages/taro-jd/types/template.d.ts @@ -11,5 +11,5 @@ export declare class Template extends UnRecursiveTemplate { key: string; type: string; }; - replacePropName(name: any, value: any): any; + replacePropName(name: any, value: any, componentName: any): any; } diff --git a/packages/taro-mini-runner/src/__tests__/__snapshots__/jd.spec.ts.snap b/packages/taro-mini-runner/src/__tests__/__snapshots__/jd.spec.ts.snap index 130851c329fb..1f2a9fd3fb99 100644 --- a/packages/taro-mini-runner/src/__tests__/__snapshots__/jd.spec.ts.snap +++ b/packages/taro-mini-runner/src/__tests__/__snapshots__/jd.spec.ts.snap @@ -909,7 +909,7 @@ require(\\"./taro\\");