fix(Tab): tab(with sticky prop) loss 'fixed' classname after switch tab #12547
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.
fix: #12535
边界场景(需要出现两个吸顶)
调整
<Sticky />
判断offset === root top
时的吸顶逻辑:调整前:逻辑是两者相等时认为可以解除吸顶
调整后:逻辑是保持吸顶,直到 offset < root top(即用户开始往上滚内容👆🏻)
这样做能兼容
<Tabs sticky />
当用户什么都不做时,只是切换吸顶tab时的情况(切换tab时offset === root top)issue 本身使用的也有问题,
<VanNavBar fixed title="pageTitle" />
本身也是固定在顶部的,必定会出现重叠的情况,最好的做法是增加tab
偏移量,例如<Tabs sticky :offset-top="46" />