├── .eslintrc.js ├── .gitignore ├── README.md ├── babel.config.js ├── deploy.sh ├── package-lock.json ├── package.json ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── components │ ├── Loader.vue │ └── Pagination.vue ├── config │ └── env.js └── main.js └── vue.config.js /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended' 9 | ], 10 | parserOptions: { 11 | parser: 'babel-eslint' 12 | }, 13 | rules: { 14 | 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 15 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | # Editor directories and files 16 | .idea 17 | .vscode 18 | *.suo 19 | *.ntvs* 20 | *.njsproj 21 | *.sln 22 | *.sw? 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vue Pagination with loader, axios REST API call without any external libraries 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | 14 | ## 🎉 [Demo Link](https://jebasuthan.github.io/vue-pagination/) 🎉 15 | 16 | ## Features available in the applilcation: 17 | 1. Individual components 18 | 2. Loader added 19 | 3. Pagination added 20 | 4. No external libraries 21 | 5. REST API implemented 22 | 6. Pagination with records per page and goto page options 23 | 7. SCSS styles 24 | 25 | 26 | ## Screenshots 27 | ### List with multiple pagination options 28 | ![Screenshot](https://user-images.githubusercontent.com/3702438/142559810-943ba84f-9f6f-4189-9f76-76540f3fbc1f.png) 29 | 30 | ![Demo](https://user-images.githubusercontent.com/3702438/142564944-01e82c6e-87b9-4713-bece-b423d36f0d7d.gif) 31 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # abort on errors 3 | set -e 4 | # build 5 | npm run build 6 | # navigate into the build output directory 7 | cd dist 8 | # if you are deploying to a custom domain 9 | # echo 'www.example.com' > CNAME 10 | git init 11 | git add -A 12 | git commit -m 'deploy' 13 | git push -f git@github.com:Jebasuthan/vue-pagination.git master:gh-pages 14 | cd - -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-pagination", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint", 9 | "deploy": "sh deploy.sh" 10 | }, 11 | "dependencies": { 12 | "axios": "^0.24.0", 13 | "core-js": "^3.6.5", 14 | "vue": "^2.6.11" 15 | }, 16 | "devDependencies": { 17 | "@vue/cli-plugin-babel": "~4.5.0", 18 | "@vue/cli-plugin-eslint": "~4.5.0", 19 | "@vue/cli-service": "~4.5.0", 20 | "@vue/eslint-config-standard": "^5.1.2", 21 | "babel-eslint": "^10.1.0", 22 | "eslint": "^6.7.2", 23 | "eslint-plugin-import": "^2.20.2", 24 | "eslint-plugin-node": "^11.1.0", 25 | "eslint-plugin-promise": "^4.2.1", 26 | "eslint-plugin-standard": "^4.0.0", 27 | "eslint-plugin-vue": "^6.2.2", 28 | "node-sass": "^4.12.0", 29 | "sass-loader": "^8.0.2", 30 | "vue-template-compiler": "^2.6.11" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jebasuthan/vue-pagination/3f8995586e632ffe999174cf2dc4d09fcc16571a/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 86 | 87 | 140 | -------------------------------------------------------------------------------- /src/components/Loader.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 54 | 84 | -------------------------------------------------------------------------------- /src/components/Pagination.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 124 | 154 | -------------------------------------------------------------------------------- /src/config/env.js: -------------------------------------------------------------------------------- 1 | /** 2 | * baseAPIUrl 3 | */ 4 | const baseApiURL = 'https://api.instantwebtools.net' 5 | 6 | export { 7 | baseApiURL 8 | } 9 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | 4 | Vue.config.productionTip = false 5 | 6 | new Vue({ 7 | render: h => h(App) 8 | }).$mount('#app') 9 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | publicPath: process.env.NODE_ENV === 'production' 3 | ? '/vue-pagination/' 4 | : '/' 5 | } 6 | --------------------------------------------------------------------------------