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(swiper): 在动态修改height值后,组件视图未更新 (#2485) #2625

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

yi-boide
Copy link
Contributor

这个 PR 做了什么? (简要描述所做更改)
swiper在动态修改height值后,组件视图未更新

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

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

这个 PR 涉及以下平台:

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

这个 PR 是否已自测:

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9e42ed2) 84.92% compared to head (f70f64c) 84.94%.
Report is 4 commits behind head on v4.

Additional details and impacted files
@@            Coverage Diff             @@
##               v4    #2625      +/-   ##
==========================================
+ Coverage   84.92%   84.94%   +0.01%     
==========================================
  Files         152      152              
  Lines       21178    21193      +15     
  Branches     2379     2386       +7     
==========================================
+ Hits        17986    18002      +16     
+ Misses       3187     3186       -1     
  Partials        5        5              
Files Coverage Δ
src/packages/__VUE/swiper/index.vue 86.02% <100.00%> (+0.27%) ⬆️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eiinu eiinu linked an issue Oct 30, 2023 that may be closed by this pull request
() => props.height,
(val) => {
Taro.nextTick(() => {
init(+val);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

调用 init 方法的参数需要修改

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改成什么呢?我看其他watch也是这样的

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改成什么呢?我看其他watch也是这样的

init 方法的参数是激活 swiper-item 的下标,height 的变化不涉及它的变动,应该传空

@eiinu eiinu merged commit 1a17233 into jdf2e:v4 Oct 30, 2023
5 checks passed
@yi-boide yi-boide deleted the swiper-height branch October 30, 2023 10:54
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.

swiper组件,在动态修改height值后,组件视图未更新
2 participants