diff --git a/.babelrc b/.babelrc deleted file mode 100644 index c51ff9c..0000000 --- a/.babelrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "presets": [ - ["env", { "modules": false }], - "stage-3" - ], - "env": { - "test": { - "presets": [ - ["env", { "targets": { "node": 8 }}] - ] - } - } -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..6a9d8c4 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,17 @@ +module.exports = { + root: true, + env: { + node: true, + }, + extends: [ + 'plugin:vue/essential', + '@vue/airbnb', + ], + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + }, + parserOptions: { + parser: 'babel-eslint', + }, +}; diff --git a/.gitignore b/.gitignore index e6dfc92..37da0a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ .DS_Store node_modules/ -public/dist/ +dist/ coverage/ npm-debug.log yarn-error.log diff --git a/.travis.yml b/.travis.yml index 06a1b4d..bb3bfa1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ cache: install: - yarn install script: - - yarn run test \ No newline at end of file + - yarn test:unit \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..430fd55 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +## Contribute diff --git a/README.md b/README.md index fc85063..36895bf 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,9 @@ $ npm i -S vue-tiny-pagination ```html
- GitHub | Latest version: -
-- This component provides a basic styles for pagination and a minimalistic design. This pagination can be used for paginate tables, data lists, etc. -
-
-
Install with NPM
-$npm install vue-tiny-pagination --save
- Install with Yarn
-$yarn add vue-tiny-pagination
- <div id="app">
- <tiny-pagination>
- :total="total"
- @tiny:change-page="changePage"></tiny-pagination>
-</div>
- import Vue from 'vue'
-import TinyPagination from 'vue-tiny-pagination'
-
-new Vue({
- el: '#app',
- data () {
- return {
- total: 100,
- currentPage: 1
- }
- },
- methods: {
- changePage (pagination) {
- console.log(pagination.page)
- }
- },
- components: {
- TinyPagination
- }
-})
- Id | -First Name | -Last name | -- |
---|---|---|---|
{{user.id}} | -{{user.first_name}} | -{{user.last_name}} | -
- |
-
Prop | -Type | -Default | -Description | -
---|---|---|---|
total (required) | -Number | -- | -A number of total items. | -
page | -Number | -1 | -Prop to set a default page. | -
lang | -String | -en | -Default language to show (Available: en, es). | -
customClass | -String | -"" | -Prop to set a custom class. | -
limits | -Array | -[10, 15, 20, 50, 100] | -Prop to set a default limits to page sizes. | -
showLimit | -Boolean | -true | -Prop to disable the limit selector. | -
Event | -Description | -
---|---|
tiny:change-page | -Get the current page from pagination payload: {page: 1} . |
-
tiny:change-limit | -Get the current limit from pagination payload: {limit: 10} . |
-
February, 2017
-[v0.1.0] Initial commit and first release.
-[v0.1.1] Updated typo on README.md.
-[v0.1.2] Changed default pageSize from 15 to 10
. Added cursor not-allowed
for disabled page-items.
[v0.2.0] Added prop for items per page and event for $emit
the current limit (payload: {limit: 10}
). Added testing for minor functionality.
[v0.2.1] Added builds for use in browser and refactoring project structure.
-[v0.2.2] Now you can disable a limit selector using a showLimit
prop.
March, 2017
-[v0.2.1] Added builds for use in browser and refactoring project structure.
-