-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat: Tabs 在选中项更变后自动滚动定位至当前激活的 Tab #3685
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
刚好我也需要这个功能, 这里还有一个场景 初始化的时候就需要滚动一次位置(:value的初始值对应的位置) 是不是可以移一哈 onMounted(() => {
watch(
mergedValueRef,
() => {
const currentEl = getCurrentEl()
const { value: xScrollInst } = xScrollInstRef
if (!currentEl || !xScrollInst || !xScrollInst.$el) return
xScrollInst.scrollTo({
left:
currentEl.clientWidth +
currentEl.offsetLeft -
xScrollInst.$el.offsetWidth / 2,
top: 0,
behavior: 'smooth'
})
},
{ flush: 'post', immediate: true },
)
}) 申明: 我不是该库的贡献者, 只是刚好有这个需求O O |
Signed-off-by: 0xyk3r <[email protected]>
Signed-off-by: 0xyk3r <[email protected]>
…r/naive-ui into feat-tabs-sync-current-tab
Signed-off-by: 0xyk3r <[email protected]>
XieZongChen
approved these changes
Sep 6, 2022
update CHANGELOG.en-US.md
如果没溢出的话还是不滚比较好 |
处理了一下 536b755 |
为什么我觉得滚动到当前标签是正常的呢,不滚动反而很诡异 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
feat: Tabs 在选中项更变后自动滚动定位至当前激活的 Tab #3683