2

I am using vue-infinite-loading. I followed their documention. but don't understand. what are $state , $state->loaded(),$state->complete();

Below image is the error i am facing.

The error i am geeting

    fetchReviews($state){
         var vm = this;
        axios.post('./fetch-reviews', {
            u_id: vm.u_id,
            params: {
            page: this.page,
    },
        })
        .then(({ data }) => {
            if (data.reviews.length) {
            this.page += 1;
            this.list.push(...data.reviews);
            $state.loaded();
            } else {
            $state.complete();
            }
        });

    }, 
weaver
  • 453
  • 1
  • 8
  • 21

0 Answers0