fix(tabs): 修复 tabs 组件选中下划线在初始化时会从最左面移到目标位置的问题 #649
Merged
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在 vant 以及 antd 等组件中,初始化 tab 组件后,选中下划线会直接定位到选中的 tab 下面:

而在 react-vant 中,选中下划线会从最左面移到选中 tab 下面,与 vant 交互不一致,看起来像是过早展现并加载了下划线的动画。

该 PR 修复了这个问题,让 react-vant 的 tab 选中下划线的交互和 vant 等主流移动端组件库一致。
cc @3lang3