0.2.8 • Published 2 years ago

refreshable v0.2.8

Weekly downloads
81
License
MIT
Repository
github
Last release
2 years ago

Refreshable

npm npm vue2

a pull to refresh component for vue

refreshable.gif

Installation

npm i refreshable
  1. globally
import Refreshable from 'refreshable'
import 'refreshable/dist/assets/refreshable.css'

Vue.use(Refreshable)
  1. partially
import { Refreshable } from 'refreshable'
import 'refreshable/dist/assets/refreshable.css'

<script>
components: {
  Refreshable
}
</script>

Usage

  1. turn on pulldown or pullup simply
<refreshable ref="rf" :pulldown="true" :pullup="true" @pullingUp="doPullup" @pullingDown="doPulldown">
  // your html
</refreshable>
  1. custom-built for your own
 <refreshable ref="rf" :pulldown="{
            threshold: 50,
            text: {
              loading: 'loading for u',
              normal: 'pull to refresh',
              done: 'done'
            },
            img: 'random' // spinner/circular/dots/random(default)
          }" :pullup="{
            threshold: 10,
            text: { loading: 'loading', done: 'done', normal: 'pull up and load more', noMore: 'all loaded' },
            img: 'circular' // spinner/circular/dots/random(default)
          }" @pullingUp="doPullup" @pullingDown="doPulldown">
  // your html      
</refreshable>
  1. closure funcs
  • 3.1 endpoint
this.$refs.refreshable.endPullDown() // for pull down event
this.$refs.refreshable.endPullUp(hasMore: Boolean) // for pull up event
  • 3.2 layout recalculate
this.$refs.refreshable.setNeedsLayout()
  • 3.3 auto refresh
this.$refs.refreshable.autoRefresh()
  • 3.4 resume pullUp
this.$refs.refreshable.resumePullUp()

Notice

your fixed component or dom element will not effects when wrapped in <refreshable> cause of the dependency of the lib is base on transform. therefore, your should place all fixed elements out of the wrapper.

3.0.4

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

0.2.8

2 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.2

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago