提交 2e0914ff 编写于 作者: F fengweiyao

fix(scroll-nav): assign "active" when touch start in jumping progress

上级 25fc58f2
......@@ -7,6 +7,7 @@
:options="options"
:data="data"
@scroll="scrollHandler"
@before-scroll-start="beforeScrollStartHandler"
@scroll-end="scrollEndHandler">
<slot name="prepend"></slot>
<div class="cube-scroll-nav-main">
......@@ -79,7 +80,7 @@
},
data() {
return {
scrollEvents: ['scroll', 'scroll-end'],
scrollEvents: ['scroll', 'scroll-end', 'before-scroll-start'],
scrollY: 0,
panels: [],
active: this.current,
......@@ -182,11 +183,11 @@
})
this.$emit(EVENT_STICKY_CHANGE, current)
},
beforeScrollStartHandler() {
this.active = this.stickyCurrent
},
scrollHandler(pos) {
this.scrollY = -pos.y
if (!this._jumping) {
this.active = this.stickyCurrent
}
},
scrollEndHandler() {
this._jumping = false
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册