Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
[ci-skip]
  • Loading branch information
pascalbaljet committed Oct 6, 2024
1 parent 350b5ba commit 66bc68a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,19 @@ export default {
// Restore tab from local storage
const tab = localStorage.getItem('codeGroupTab')
if (tab) {
preventScroll = true

nextTick(() => {
preventScroll = true
showCodeWithLabel(tab)
preventScroll = false
bindClickEvent()

showCodeWithLabel(tab)
nextTick(() => {
preventScroll = false
window.scrollTo({
top: 0,
behavior: 'instant'
})
})
})
}
},
Expand Down

0 comments on commit 66bc68a

Please sign in to comment.