text: import BScroll from '@better-scroll/core'
  import PullUp from '@better-scroll/pull-up'
  import ObserveDOM from '@better-scroll/slide'
  import { ref, onMounted, onUnmounted, onActivated, onDeactivated } from 'vue'
  
  BScroll.use(PullUp)
  BScroll.use(ObserveDOM)
  export default function usePullUpLoad (requestData) {
    const scroll = ref(null)
    const rootRef = ref(null)
    const isPullUpLoad = ref(false)
  
    onMounted(() => {
      const scrollVal = scroll.value = new BScroll(rootRef.value, {
        pullUpLoad: true,
        observeDOM: true,
        click: true
      })
      scrollVal.on('pullingUp', pullingUpHandler)
  
      async function pullingUpHandler () {
        isPullUpLoad.value = true
        await requestData()
        scrollVal.finishPullUp()
        isPullUpLoad.value = false
      }
    })
  
    onUnmounted(() => {
      scroll.value.destroy()
    })
  
    onActivated(() => {
      scroll.value.enable()
      scroll.value.refresh()
    })
  
    onDeactivated(() => {
      scroll.value.disable()
    })
  
    return {
      rootRef,
      isPullUpLoad
    }
  }
  