提交 6da9bc9e 编写于 作者: Q qiang

Merge branch 'dev' into alpha

......@@ -123,7 +123,7 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
if (matchRule && matchRule.use) {
if (runByHBuilderX) {
matchRule.use.forEach(matchUse => {
if (matchUse.loader === 'ts-loader') {
if (matchUse.loader.includes('ts-loader')) {
Object.assign(matchUse.options, tsLoaderOptions)
}
})
......
......@@ -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,26 +324,10 @@ export default {
self._setRefreshState('refresherabort')
}
}
this.$refs.main.addEventListener(
'touchstart',
this.__handleTouchStart,
passiveOptions
)
this.$refs.main.addEventListener('touchmove', this.__handleTouchMove)
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 () {
......@@ -363,11 +349,7 @@ export default {
this.$refs.main.removeEventListener(
'scroll',
this.__handleScroll,
supportsPassive
? {
passive: false
}
: false
passive(false)
)
this.$refs.main.removeEventListener(
'touchend',
......
......@@ -444,12 +444,22 @@ export default {
position -= length
}
} else if (n > 0) {
/**
* current -> 1
* position -> 2
* length -> 3
*
* position -> -1
*/
for (; position > current;) {
position -= length
}
for (; position + length < current;) {
position += length
}
if (position + length - current < current - position) {
position += length
}
} else {
for (; position + length < current;) {
position += length
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册