Skip to content

Commit 61951e2

Browse files
author
Javier Diaz
committed
docs: updated documentation
1 parent 846c0cc commit 61951e2

File tree

3 files changed

+169
-0
lines changed

3 files changed

+169
-0
lines changed

CONTRIBUTING.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## Contribute
2+
We would love for you to contribute and help make it even better than it is todat! As a contributor, here are the guidelines we would like you to follow:
3+
4+
## Development Setup
5+
You will need Node.js version +8.9.0.
6+
1. After clonning the repo, run:
7+
```bash
8+
$ npm i # or yarn install
9+
```
10+
11+
### Commonly use NPM scripts
12+
```bash
13+
# build all packages
14+
$ npm run build
15+
16+
# run full unit-tests suite
17+
$ npm run test:unit
18+
19+
# run linter
20+
$ npm run lint
21+
```
22+
23+
## Found a Bug?
24+
If you find a bug in source code, you can help us by submitting an issue to our GitHub repository. Even better, you can submit a Pull Request with a fix.
25+
26+
## Missing a Feature?
27+
You can request a new feature by submitting an issue to our GitHub repository. If you would like to implement a new feature, please submit an issue with a proposal for your work first, to be sure that we can use it. Please consider what kind of change it is:
28+
- For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed. This will also allow us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted in the project. For your issue name, please prefix your proposal with `[discussion]`, for example "[discussion]: your feature idea".
29+
- **Small Features** can be crafted and firectly submitted as a Pull Request.
30+
31+
## Coding Rules
32+
To ensure consistency throughout the source code, keep these rules in mind as you are working:
33+
- All feature or bug fixes **must be tested** by one or more specs (unit-tests).
34+
- We follow [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript), but wrap all code at **100 characters**.
35+
36+
## Commit Message Guidelines
37+
We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. But also, we use git commit messages to **generate the change log**.
38+
39+
### Type
40+
Must be one of the following:
41+
- **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm).
42+
- **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs).
43+
- **docs**: Documentation only changes.
44+
- **feature**: A new feature.
45+
- **bugfix**: A bug fix.
46+
- **refactor**: A code change that neither fixes a bug nor adds a feature.
47+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
48+
- **test**: Adding missing tests or correcting existing tests.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018-2019 Javier Diaz Chamorro
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<p align="center">
2+
<a href="#"><img src="logotype.png" width="380"></a>
3+
<h4 align="center">A Vue component for create a tiny pagination with Flexbox</h4>
4+
</p>
5+
6+
<p align="center">
7+
<a href="https://npmjs.com/package/vue-tiny-pagination"><img src="https://img.shields.io/npm/dt/vue-tiny-pagination.svg?style=flat-square"></a>
8+
<a href="https://github.com/coderdiaz/vue-tiny-pagination/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square"></a>
9+
<a href="https://github.com/coderdiaz/vue-tiny-pagination/stargazers"><img src="https://img.shields.io/github/stars/coderdiaz/vue-tiny-pagination.svg?style=flat-square"></a>
10+
<a href="http://npmjs.com/package/vue-tiny-pagination"><img src="https://img.shields.io/npm/v/vue-tiny-pagination.svg?style=flat-square"></a>
11+
<a href="http://npmjs.com/package/vue-tiny-pagination"><img src="https://img.shields.io/npm/dm/vue-tiny-pagination.svg?style=flat-square"></a>
12+
<a href="https://travis-ci.org/coderdiaz/vue-tiny-pagination"><img src="https://travis-ci.org/coderdiaz/vue-tiny-pagination.svg?branch=master&style=flat-square"></a>
13+
</p>
14+
15+
---
16+
17+
## Install/Usage
18+
<!-- Replace the docs for usage the plugin -->
19+
```sh
20+
# Install with npm
21+
$ npm i -S vue-tiny-pagination
22+
23+
# or yarn
24+
$ yarn add vue-tiny-pagination
25+
```
26+
27+
```html
28+
<div id="app">
29+
<tiny-pagination
30+
:total="currentTotal"
31+
@tiny:change-page="changePage" />
32+
</div>
33+
```
34+
35+
You can use **Local Registration**:
36+
```js
37+
import { TinyPagination } from 'vue-tiny-pagination';
38+
new Vue({
39+
el: '#app',
40+
data() {
41+
return {
42+
currentTotal: 100,
43+
currentPage: 1,
44+
};
45+
},
46+
methods: {
47+
changePage (pagination) {
48+
this.currentPage = pagination.page;
49+
},
50+
},
51+
components: {
52+
TinyPagination,
53+
},
54+
});
55+
```
56+
57+
or **Global Registration**:
58+
```js
59+
import TinyPagination from 'vue-tiny-pagination';
60+
Vue.use(TinyPagination);
61+
62+
// or with a custom component name
63+
import { TinyPagination } from 'vue-tiny-pagination';
64+
Vue.component('custom-hello-world', TinyPagination);
65+
```
66+
67+
### Usage in browser
68+
<!-- Write an example for use the plugin in browser from CDN -->
69+
In browser you can use Unpkg, Jsdelivr, CDN.js, etc.
70+
```sh
71+
# Unpkg
72+
https://unpkg.com/vue-tiny-pagination@latest/dist/vue-tiny-pagination.js
73+
74+
# JSDelivr
75+
https://cdn.jsdelivr.net/npm/vue-tiny-pagination@latest/dist/vue-tiny-pagination.min.js
76+
```
77+
78+
## Documentation
79+
<!-- Add all documentation about the plugin: props, events, etc -->
80+
### Props
81+
|Name|Description|Type|Default|Required|
82+
|---|---|---|---|---|
83+
|total|A number of total items|Number|-|true|
84+
|page|Prop to set a default page|Number|1|false|
85+
|lang|Default language to show (Available: en, es)|String|en|false|
86+
|customClass|Prop to set a custom class.|String|""|false|
87+
|limits|Prop to set a default limits to page sizes.|Array|[10, 15, 20,50,100]|false|
88+
|showLimit|Prop to disable the limit selector|Boolean|true|false|
89+
90+
### Events
91+
|Event|Description|
92+
|---|---|
93+
|tiny:change-page|Get the current page from pagination `payload: { page: 1 }`|
94+
|tiny:change-limit|Get the current limit from pagination `payload: { limit: 1 }`|
95+
96+
## Community
97+
All feedback and suggestions are welcome!
98+
99+
## License
100+
This is a open-source software licensed under the [MIT license](https://raw.githubusercontent.com/coderdiaz/vue-tiny-pagination/master/LICENSE)

0 commit comments

Comments
 (0)