Skip to content

Commit 4cf7060

Browse files
author
Henrik Ruscon
committed
fix scrollspy active on init
1 parent 9f15286 commit 4cf7060

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/ScrollSpy.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ export default {
7070
block: 'start',
7171
inline: 'nearest'
7272
})
73+
} else {
74+
this.currentItem = this.getItemInsideWindow()
75+
if (this.currentItem) this.currentItem.classList.add(this.activeClass)
7376
}
7477
7578
// Scrolling lacks callback & is async

0 commit comments

Comments
 (0)