-
Notifications
You must be signed in to change notification settings - Fork 834
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(elevator): 修复点击楼层未准确高亮对应的楼层位置信息 #3149
base: v4
Are you sure you want to change the base?
Conversation
Walkthrough此次更新主要集中在简化和优化 Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v4 #3149 +/- ##
==========================================
- Coverage 81.20% 81.19% -0.01%
==========================================
Files 226 226
Lines 18139 18137 -2
Branches 2485 2484 -1
==========================================
- Hits 14729 14726 -3
- Misses 3392 3393 +1
Partials 18 18 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/packages/__VUE/elevator/index.taro.vue (6 hunks)
Additional comments not posted (6)
src/packages/__VUE/elevator/index.taro.vue (6)
57-57
: 移除nextTick
导入
nextTick
已被移除,代码简化了。
119-119
: 计算属性clientHeight
计算属性
clientHeight
实现正确。
135-137
: 简化函数setListGroup
函数
setListGroup
逻辑简化,确保只有非空元素被添加到state.listGroup
中。
147-147
: 使用Math.round
进行高度计算使用
Math.round
代替Math.floor
可以提供更准确的高度计算。
165-166
: 函数touchStart
函数
touchStart
实现正确,设置初始触摸状态并滚动到相应的索引。
196-204
: 重构函数listViewScroll
使用
const
和解构赋值提高了代码的可读性和可维护性。
related issue #3145 假设某个楼层的区间在 |
需要将逻辑修改同步到 |
我在 |
可以参考仓库内的贡献指南(contributing)。 |
got it. 我调整下 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/packages/__VUE/elevator/index.vue (4 hunks)
Additional comments not posted (5)
src/packages/__VUE/elevator/index.vue (5)
24-24
: 简化插值表达式将插值表达式简化为单行,提高了代码的可读性,并且不影响功能。
96-96
: 简化计算属性将计算属性简化为箭头函数,减少了冗余,同时保持了相同的逻辑。
104-106
: 优化 setListGroup 函数移除了
nextTick
包装器,增强了性能,避免了不必要的异步调度。
114-114
: 改进 calculateHeight 函数将
Math.floor
改为Math.round
,以提供更准确的元素渲染高度。
162-170
: 优化 listViewScroll 函数通过合并变量声明和使用解构赋值替换高度比较,改进了代码的清晰度并减少了认知负担。
这个 PR 做了什么? (简要描述所做更改)
修复了点击楼层导航,高亮的索引位置计算有误
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台:
这个 PR 是否已自测:
Summary by CodeRabbit
错误修复
<view>
标签的语法错误。代码重构
clientHeight
计算属性和setListGroup
函数逻辑。Math.floor
改为Math.round
。listViewScroll
函数中使用const
和解构赋值来声明变量,提高了代码的可读性。