提交 c076fd00 编写于 作者: D DCloud_LXH

chore: scroll-view

上级 b58eea43
......@@ -86,11 +86,13 @@ import {
disableScrollBounce
} from 'uni-platform/helpers/scroll'
const passiveOptions = supportsPassive
? {
passive: true
}
: false
const passive = (passive = true) =>
supportsPassive
? {
passive
}
: false
const passiveOptions = passive()
// const PULLING = 'pulling'
// const REFRESHING = 'refreshing'
......@@ -322,34 +324,10 @@ export default {
self._setRefreshState('refresherabort')
}
}
this.$refs.main.addEventListener(
'touchstart',
this.__handleTouchStart,
passiveOptions
)
this.$refs.main.addEventListener(
'touchmove',
this.__handleTouchMove,
supportsPassive
? {
passive: false
}
: false
)
this.$refs.main.addEventListener(
'scroll',
this.__handleScroll,
supportsPassive
? {
passive: false
}
: false
)
this.$refs.main.addEventListener(
'touchend',
this.__handleTouchEnd,
passiveOptions
)
this.$refs.main.addEventListener('touchstart', this.__handleTouchStart, passiveOptions)
this.$refs.main.addEventListener('touchmove', this.__handleTouchMove, passive(false))
this.$refs.main.addEventListener('scroll', this.__handleScroll, passive(false))
this.$refs.main.addEventListener('touchend', this.__handleTouchEnd, passiveOptions)
initScrollBounce()
},
activated () {
......@@ -371,11 +349,7 @@ export default {
this.$refs.main.removeEventListener(
'scroll',
this.__handleScroll,
supportsPassive
? {
passive: false
}
: false
passive(false)
)
this.$refs.main.removeEventListener(
'touchend',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册