Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
vue-bootstrap-pagination
Advanced tools
Readme
Vue pagination component for use with Bootstrap and Laravel pagination.
To use with Vue.js 1 use the 1x version.
Laravel is not required as long as the pagination object contains the required attributes
npm install --save vue-bootstrap-pagination
or
yarn add vue-bootstrap-pagination
import pagination from 'vue-bootstrap-pagination'
new Vue({
el: '#app',
data() {
return {
items: [],
pagination: {
total: 0,
per_page: 12, // required
current_page: 1, // required
last_page: 0, // required
from: 1,
to: 12
},
paginationOptions: {
offset: 4,
previousText: 'Prev',
nextText: 'Next',
alwaysShowPrevNext: true
}
}
},
methods: {
loadData() {
const options = {
params: {
paginate: this.pagination.per_page,
page: this.pagination.current_page,
/* additional parameters */
}
};
this.$http.get('/getData', options)
.then(response => {
this.items = response.data.data;
// Overwrite pagination object
this.pagination = response.data.pagination; // API response edited to have pagination data under pagination object
// Or overwrite only values
/*
this.pagination.current_page = response.data.current_page;
this.pagination.last_page = response.data.last_page;
...
*/
})
.catch(error => {
// handle error
});
}
},
components: {
pagination
}
})
<body id="app">
<ul class="list-group">
<li class="list-group-item" v-for="item in items">{{ item.name }}</li>
</ul>
<pagination :pagination="pagination" :callback="loadData" :options="paginationOptions"></pagination>
</body>
Name | Type | Default | Required | Description |
---|---|---|---|---|
pagination | Object | true | Pagination object used to create pagination | |
callback | Function | true | Callback function used to load data for selected page | |
options | Object | Configuration. Look below for available options | ||
size | String | Change the default size of the pagination. Options: large, small. |
Offset prop has ben removed with version 2.10.0. Use options.offset
instead
Name | String | Default | Description |
---|---|---|---|
offset | Number | 3 | Left and right offset of pagination numbers to display |
ariaPrevious | String | Previous | Change default aria previous text |
ariaNext | String | Next | Change default aria next text |
previousText | String | « | Change default previous button text |
nextText | String | » | Change default next button text |
alwaysShowPrevNext | Boolean | false | Show prev/next button even if on first/last page |
If you change this.pagination.per_page
the callback function will be called
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.
FAQs
Pagination for vuejs with combination with bootstrap and Laravel's pagination
The npm package vue-bootstrap-pagination receives a total of 223 weekly downloads. As such, vue-bootstrap-pagination popularity was classified as not popular.
We found that vue-bootstrap-pagination demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.