Skip to content

Commit

Permalink
fix(jd): 修复京东小程序onLongPress事件失效
Browse files Browse the repository at this point in the history
  • Loading branch information
最刚 committed Jul 12, 2021
1 parent f6fc3b0 commit 027e8d6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/taro-jd/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit 027e8d6

Please sign in to comment.