vue-ads-pagination
Advanced tools
Comparing version 0.1.6 to 0.1.7
{ | ||
"name": "vue-ads-pagination", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"main": "./dist/vue-ads-pagination.common.js", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -21,1 +21,78 @@ # vue-ads-pagination | ||
```yarn add vue-ads-pagination``` | ||
## Usage | ||
You can use the vue-ads-pagination component by using the following code in your project. | ||
``` | ||
<template> | ||
<div id="app"> | ||
<vue-ads-pagination | ||
:startPage="3" | ||
:itemsPerPage="10" | ||
:maxVisiblePages="4" | ||
:totalItems="200" | ||
@click="click" | ||
/> | ||
</div> | ||
</template> | ||
<script> | ||
import VueAdsPagination from 'vue-ads-pagination'; | ||
export default { | ||
name: 'app', | ||
components: { | ||
VueAdsPagination, | ||
}, | ||
methods: { | ||
click (page) { | ||
console.log(page); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
``` | ||
### Properties | ||
| property | required | default | description | | ||
| --- | --- | --- | --- | | ||
| startpage | false | 0 | A zero-based number to set the initial page | | ||
| itemsPerPage | false | 10 | The max amount of items on one page | | ||
| maxVisiblePages | false | 5 | The number of pages to be visible if their are too many pages | | ||
| totalItems | true | | The total amount of items | | ||
### Methods | ||
| method | parameters | description | | ||
| --- | --- | --- | | ||
| click | page, range | Emitted if another page is clicked. Two parameters are given: The zero-based page and the range. This is an object that contain the start and end keys. They contain a zero-based number to identify the items to be shown.| | ||
## Testing | ||
We use the jest framework for testing this pagination component. Run the following command to test it: | ||
``` | ||
npm run test:unit | ||
``` | ||
## Issues | ||
If you have any issues (bugs, features, ...) on the current project, add them [here](https://gitlab.com/arnedesmedt/vue-ads-pagination/issues/new). | ||
## Contributing | ||
If you would like to contribute to the current project, follow these rules: | ||
- one pull request per issue (bug, feature, ...). | ||
- Test the changes if possible. | ||
- Update the readme if necessary. | ||
- Update the changelog if necessary. | ||
## Changelog | ||
### v0.1.7 | ||
- Readme updated |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1476893
98