ibufu / vue2-scrollspy

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

the initial value of data: section is not 1. is it? or how can I modify the initial value for section? #35

Closed JustPlayN closed 6 years ago

JustPlayN commented 6 years ago

Vue version: 2.5.16

vue2-scrollspy version: 2.3.1

<div v-show="section > 0" v-scroll-spy-active="{class: 'banner-active'}" v-scroll-spy-link></div>

this div block in wxchat will show first. and then hide right now

ibufu commented 6 years ago

具体讲一下你想实现的效果

JustPlayN commented 6 years ago

我用v-scroll-spy="{data: 'section', offset: 50}"提供的section来控制导航的显示与隐藏,但是在微信里会默认先显示,然后再立即隐藏,我想直接隐藏,手动改变section时在显示

ibufu commented 6 years ago

可以 watch section,变化了之后把 v-show 变为 true

JustPlayN commented 6 years ago

我现在的解决方法是监听滑动,没滑动过就隐藏,滑动过就根据section显示