# pullup

# Introduction

The pullup plugin provides BetterScroll with the ability to monitor pulldown operation.

# Install

npm install @better-scroll/pull-up --save

// or

yarn add @better-scroll/pull-up

# Usage

First, install the plugin via the static method BScroll.use()

  import BScroll from '@better-scroll/core'
  import PullUp from '@better-scroll/pull-up'


pass in the correct configuration in options, for example:

  new BScroll('.bs-wrapper', {
    pullUpLoad: true

# Demo

  <div class="pullup">
    <div ref="scroll" class="pullup-wrapper">
      <div class="pullup-content">
        <ul class="pullup-list">
          <li v-for="i of data" :key="i" class="pullup-list-item">
            {{ i % 5 === 0 ? 'scroll up 👆🏻' : `I am item ${i} `}}
        <div class="pullup-tips">
          <div v-if="!isPullUpLoad" class="before-trigger">
            <span class="pullup-txt">Pull up and load more</span>
          <div v-else class="after-trigger">
            <span class="pullup-txt">Loading...</span>

# pullUpLoad Options

# threshold

  • Type: number
  • Default: 0

The threshold for triggering a pullingUp hook.


When pullUpLoad is configured as true, the plugin uses the default plugin option.

const bs = new BScroll('.wrapper', {
  pullUpLoad: true

// equals

const bs = new BScroll('.wrapper', {
  pullUpLoad: {
    threshold: 0

# Instance Methods


All methods are proxied to BetterScroll instance, for example:

import BScroll from '@better-scroll/core'
import PullUp from '@better-scroll/pull-up'


const bs = new BScroll('.bs-wrapper', {
  pullUpLoad: true


# finishPullUp()

  • Details: Finish the pullUpLoad behavior.


Every time you trigger the pullingUp hook, you should actively call finishPullUp() to tell BetterScroll to be ready for the next pullingUp hook.

# openPullUp(config: PullUpLoadOptions = {})

  • Details: Turn on the pullUpLoad dynamically.

  • Arguments:

    • { PullDownRefreshOptions } config: Modify the option of the pullup plugin
    • PullDownRefreshOptions:
    export type PullUpLoadOptions = Partial<PullUpLoadConfig> | true
    export interface PullUpLoadConfig {
      threshold: number


The openPullUp method should be used with closePullUp, because in the process of generating the pullup plugin, the pullUpLoad action has been automatically monitored.

# closePullUp()

  • Details: Turn off pullUpLoad dynamically.

# autoPullUpLoad()

  • Details:Auto pullUp.

# Events

# pullingUp

  • Arguments: None
  • Trigger: When the distance to the bottom is less than the value of threshold, a pullingUp event is triggered.

When threshold is a positive number, it means pullingUp is triggered when the threshold pixel is away from the scroll boundary. On the contrary, it means that the event will be triggered when it crosses the scroll boundary.


After the pullUpLoad action is detected, the consumption opportunity of the pullingUp event is only once, so you need to call finishPullUp() to tell BetterScroll to provide the next consumption opportunity of the pullingUp event.