Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复 scroll-view 组件在 taro-h5 端的兼容问题 #2470

Merged
merged 8 commits into from
Aug 9, 2023

Conversation

eiinu
Copy link
Member

@eiinu eiinu commented Aug 2, 2023

这个 PR 做了什么? (简要描述所做更改)

存在的问题:
Taro 不能将经过 vite 构建后的渲染函数中的 scroll-view 标签二次转换为 taro-scroll-view-core 标签及其对应的 web component 组件,因此会丢失该组件上的属性、方法,导致使用了 scroll-view 的组件的滚动方法失效。

解决方案:
通过环境判断,在 h5 环境下直接使用 taro-scroll-view-core 标签,在小程序环境下仍然使用 scroll-view

涉及到的组件及其功能:
1、Tabs 的滚动居中
2、Elevator 的滚动功能
3、……

这个 PR 是什么类型? (至少选择一个)

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 代码重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

这个 PR 涉及以下平台:

  • NutUI 4.0 H5
  • NutUI 4.0 小程序
  • NutUI 3.0 H5
  • NutUI 3.0 小程序

这个 PR 是否已自测:

@eiinu eiinu linked an issue Aug 2, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #2470 (16dd99b) into v4 (76db84b) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##               v4    #2470   +/-   ##
=======================================
  Coverage   85.02%   85.02%           
=======================================
  Files         149      149           
  Lines       20390    20390           
  Branches     2289     2289           
=======================================
  Hits        17336    17336           
  Misses       3049     3049           
  Partials        5        5           

@eiinu eiinu marked this pull request as draft August 3, 2023 03:33
@eiinu eiinu marked this pull request as ready for review August 3, 2023 04:37
@eiinu eiinu marked this pull request as draft August 3, 2023 05:48
@eiinu eiinu marked this pull request as ready for review August 9, 2023 06:59
@eiinu
Copy link
Member Author

eiinu commented Aug 9, 2023

已发布 4.1.4-beta.1 测试包

@eiinu eiinu merged commit 6e61205 into jdf2e:v4 Aug 9, 2023
5 checks passed
@eiinu eiinu deleted the fix-scroll-view branch August 9, 2023 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nutui-taro 组件 nut-tabs 编译到 h5 的问题
1 participant