vue-laravel-paginate

1.0.6 • Public • Published

vue laravel paginate

this package use only laravel api purpose

download

Install Package

npm install vue-laravel-paginate

Import Package

import Paginate from "vue-laravel-paginate";

Implementation example

components: {
  Paginate
},

data() {
    return {
      data: []
    }
},

mounted() {
  this.getData()
},

methods:{
    getData(page = 1) {
        axios.get('your-laravel-api'+'?page='+page).then((response) => {
          this.data = response.data
        }).catch((error) => {
          console.log(error);
        });
    },
}

Implementation html example

  <Paginate v-on:changepage="getData($event)" 
            :from="data.from" 
            :to="data.to" 
            :total="data.total" 
            :links="data.links"
            :currentPage="data.current_page"/>

Required attribute:

1. v-on:changepage="getData($event)"
2. :links="data.links"
3. :currentPage="data.current_page"

Laravel API:

return User::paginate(25);

Author Info

Name: Rashiqul Rony
Github: https://github.com/RashiqulRony

Package Sidebar

Install

npm i vue-laravel-paginate

Weekly Downloads

0

Version

1.0.6

License

none

Unpacked Size

27.3 kB

Total Files

6

Last publish

Collaborators

  • rashiqulrony