Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
BScroll.use(MouseWheel)
options.mouseWheel = {
speed: wheelDistance,
invert: false,
easeTime: 300
}
}
if (!mouse) {
options.click = false
options.disableMouse = true
}
if (getType(pullup) === 'function') {
BScroll.use(Pullup)
const wrapper = temp.cloneNode()
wrapper.classList.add('pullup-wrapper')
const tip = spanTemp.cloneNode()
tip.textContent = pullupTip || 'Loading...'
wrapper.appendChild(tip)
tbody.appendChild(wrapper)
this.pullupWrapper = wrapper
options.pullUpLoad = {
threshold: parseInt(pullupThreshold) || 10
}
}
import BetterScrollCore from '@better-scroll/core'
import MouseWheel from '@better-scroll/mouse-wheel'
import ObserveDom from '@better-scroll/observe-dom'
import PullDownRefresh from '@better-scroll/pull-down'
import PullUpLoad from '@better-scroll/pull-up'
import ScrollBar from '@better-scroll/scroll-bar'
import Slide from '@better-scroll/slide'
import Wheel from '@better-scroll/wheel'
import Zoom from '@better-scroll/zoom'
import NestedScroll from '@better-scroll/nested-scroll'
import InfinityScroll from '@better-scroll/infinity'
BetterScrollCore.use(MouseWheel)
.use(ObserveDom)
.use(PullDownRefresh)
.use(PullUpLoad)
.use(ScrollBar)
.use(Slide)
.use(Wheel)
.use(Zoom)
.use(NestedScroll)
.use(InfinityScroll)
export default BetterScrollCore
create () {
const { table } = this.tableInstance
const { height, wheel, mouse, wheelDistance, pullup, pullupThreshold, pullupTip } = this.state
const scroller = table.querySelector('.it-tbody-group')
const tbody = scroller.querySelector('.it-tbody')
scroller.style.height = `${height}px`
tbody.style.position = 'absolute'
tbody.style.overflow = 'visible'
const options = {}
if (wheel) {
BScroll.use(MouseWheel)
options.mouseWheel = {
speed: wheelDistance,
invert: false,
easeTime: 300
}
}
if (!mouse) {
options.click = false
options.disableMouse = true
}
if (getType(pullup) === 'function') {
BScroll.use(Pullup)