vue-pull

1.2.8 • Public • Published

pull

npm install vue-pull

index.vue

  <template>
    <ul id="pullup">
      <li v-for="li in list"></li>
    </ul>
  </template>

  import Vue from 'vue';
  import pull from 'vue-pull';
  Vue.use(pull);
  
  fetchData(callback){
      fetch('',{
        page: this.page
      })
      .then(res=>{
        if (res.status !== 200) return
        callback && callback();
        this.$pull(document.querySelector('#pullup'), 'up', res.data.has_next?loaded=>{
          this.page ++;
          this.fetchData(()=>{
            loaded && loaded();
          });
        }:'done');
      });
  }
  

Package Sidebar

Install

npm i vue-pull

Weekly Downloads

3

Version

1.2.8

License

ISC

Last publish

Collaborators

  • gengfire