ibufu / vue2-scrollspy

Scrollspy for Vue2
https://ibufu.github.io/vue2-scrollspy/
MIT License
135 stars 32 forks source link

Scroll detection stop after page reload #38

Open Sceat opened 5 years ago

Sceat commented 5 years ago

Vue version: 2.6.8

vue2-scrollspy version: 2.3.1

Expected behavior:

Should add the active class properly

Actual behavior:

Work properly after a vue dev server hot-reload but stop adding the active class after a browser page reload

Demo link:

ul.tabs(v-scroll-spy-active v-scroll-spy-link="{selector: 'li'}")
            li.tab(v-for="c in myarray" :key="c") {{c}}
.food(v-scroll-spy)
    custom-component(v-for="c in myarray" :key="c")

Workaround

.food(v-scroll-spy)
    .useless-div(v-for="c in myarray" :key="c") 
        custom-component