hooks icon indicating copy to clipboard operation
hooks copied to clipboard

taro跨端小程序环境下canUseDom判断依据不足,addEventListener undef

Open LesterWeng opened this issue 2 years ago • 2 comments

[中文版模板 / Chinese template]

🤔 This is a ...

  • [ ] New feature
  • [x] Bug fix
  • [ ] Site / documentation update
  • [ ] Demo update
  • [ ] TypeScript definition update
  • [ ] Bundle size optimization
  • [ ] Performance optimization
  • [ ] Enhancement feature
  • [ ] Internationalization
  • [ ] Refactoring
  • [ ] Code style optimization
  • [ ] Test Case
  • [ ] Branch merge
  • [ ] Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • [ ] Doc is updated/provided or not needed
  • [ ] Demo is updated/provided or not needed
  • [ ] TypeScript definition is updated/provided or not needed
  • [ ] Changelog is provided or not needed

LesterWeng avatar Jun 29 '22 06:06 LesterWeng

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 29 '22 06:06 CLAassistant

taro3.2.15版本 不存在window.addEventListener

LesterWeng avatar Jun 29 '22 08:06 LesterWeng

window.addEventListener IE9 都支持的东西,taro 3.2.15 不支持,没办法,为特定工具做 polyfill 代价太大。

另外,要支持的话,也不能只是加个检测判空那么简单,还得让功能可用起来,比较麻烦,需要给缺少的 api 都加上可用的 polyfill,所以只能靠工具自己支持了~

目前来看,最新的 taro 已经处理了,PR 关了~

liuyib avatar Sep 27 '23 06:09 liuyib