Skip to content

Vue.JS pagination component, mimics WordPress pagination links, uses Bootstrap formatting.

License

Notifications You must be signed in to change notification settings

zenithtech/vue-pagination

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-pagination

Vue.JS pagination component, mimics WordPress pagination links, uses Bootstrap formatting.

Uses FontAwesome and Bootstrap.

foo

Add the pagination_data and pagination_goto properties to the app:

const main = new Vue({
    el: '#main',
    data() {
        return {
		pagination_data: [],
		pagination_goto: 1
        };
    }
});

Initialize your component within your app:

Vue.component(
	'pagination',
	require('./components/Pagination.vue').default
);

Then include the compomenet in your HTML as such, where other-component is where Ajax calls are made:

<other-component :pagination_data.sync="pagination_data" :pagination_goto.sync="pagination_goto"></other-component>

<pagination :pagination_data.sync="pagination_data" :pagination_goto.sync="pagination_goto"></pagination>

Within other-component we watch for when pagination_goto changes upon clicking a link in pagination, and call the ajax function passing it the page number.

Within pagination we watch for when pagination_data is received and update the current page number.

About

Vue.JS pagination component, mimics WordPress pagination links, uses Bootstrap formatting.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published