Plugin Options
ScrollView may be initialized with some options, outlined here.
import Vue from 'vue'
import ScrollView from 'vue-scrollview'
// default options
const options = {
throttle: 50,
callbacks: []
}
Vue.use(ScrollView, options) // optional options object may be passed in at initialization.
throttle
type: { Number }
- Default:
50
- Usage:
ScrollView listens to the onscroll
event to run checks for component visibility. By default, this is operation is throttled by 50ms for performance. This will be probably be fine for most use-cases, however, if performance degradation is evident try throttling by a higher number.
callbacks
type: { Array }
- Default:
[]
- Usage:
You may need to listen to the onscroll
event for something unrelated to ScrollView. Add functions to the callbacks
option that will be called onscroll
in the order they appear in the array. Each function receives ScrollView internal state as a parameter.