├── .gitignore ├── README.md ├── babel.config.js ├── package-lock.json ├── package.json ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── assets │ ├── logo.png │ └── logo.svg ├── components │ ├── AddTutorial.vue │ ├── Tutorial.vue │ └── TutorialsList.vue ├── http-common.js ├── main.js ├── plugins │ └── vuetify.js ├── router.js └── services │ └── TutorialDataService.js └── vue.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vuetify data-table example with CRUD App | v-data-table 2 | 3 | For more detail, please visit: 4 | > [Vuetify data-table example with CRUD App](https://bezkoder.com/vuetify-data-table-example/) 5 | 6 | More Practice: 7 | > [Vuetify Pagination (Server Side) example](https://bezkoder.com/vuetify-pagination-server-side/) 8 | 9 | > [Vuetify File upload example](https://bezkoder.com/vuetify-file-upload/) 10 | 11 | Using Bootstrap instead: 12 | > [Vue.js CRUD App with Vue Router & Axios](https://bezkoder.com/vue-js-crud-app/) 13 | 14 | > [Vue Pagination with Axios and API (Server Side pagination) example](https://bezkoder.com/vue-pagination-axios/) 15 | 16 | Server side Pagination for this app: 17 | 18 | > [Server side Pagination in Node.js with Sequelize and MySQL](https://bezkoder.com/node-js-sequelize-pagination-mysql/) 19 | 20 | > [Spring Boot Pagination and Filter example](https://bezkoder.com/spring-boot-pagination-filter-jpa-pageable/) 21 | 22 | Fullstack with Node.js Express: 23 | > [Vue.js + Node.js Express + MySQL](https://bezkoder.com/vue-js-node-js-express-mysql-crud-example/) 24 | 25 | > [Vue.js + Node.js Express + PostgreSQL](https://bezkoder.com/vue-node-express-postgresql/) 26 | 27 | > [Vue.js + Node.js Express + MongoDB](https://bezkoder.com/vue-node-express-mongodb-mevn-crud/) 28 | 29 | Fullstack with Spring Boot: 30 | > [Vue.js + Spring Boot](https://bezkoder.com/spring-boot-vue-js-crud-example/) 31 | 32 | > [Vue.js + Spring Boot + MongoDB](https://bezkoder.com/spring-boot-vue-mongodb/) 33 | 34 | Fullstack with Django: 35 | > [Vue.js + Django](https://bezkoder.com/django-vue-js-rest-framework/) 36 | 37 | ## Project setup 38 | ``` 39 | npm install 40 | ``` 41 | 42 | ### Compiles and hot-reloads for development 43 | ``` 44 | npm run serve 45 | ``` 46 | 47 | ### Compiles and minifies for production 48 | ``` 49 | npm run build 50 | ``` 51 | 52 | ### Run your tests 53 | ``` 54 | npm run test 55 | ``` 56 | 57 | ### Lints and fixes files 58 | ``` 59 | npm run lint 60 | ``` 61 | 62 | ### Customize configuration 63 | See [Configuration Reference](https://cli.vuejs.org/config/). 64 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vuetify-data-table-example", 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 | }, 10 | "dependencies": { 11 | "axios": "^0.20.0", 12 | "core-js": "^3.6.5", 13 | "vue": "^2.6.11", 14 | "vue-router": "^3.4.3", 15 | "vuetify": "^2.2.11" 16 | }, 17 | "devDependencies": { 18 | "@vue/cli-plugin-babel": "^4.5.0", 19 | "@vue/cli-plugin-eslint": "^4.5.0", 20 | "@vue/cli-service": "^4.5.0", 21 | "babel-eslint": "^10.1.0", 22 | "eslint": "^6.7.2", 23 | "eslint-plugin-vue": "^6.2.2", 24 | "sass": "^1.19.0", 25 | "sass-loader": "^8.0.0", 26 | "vue-cli-plugin-vuetify": "^2.0.7", 27 | "vue-template-compiler": "^2.6.11", 28 | "vuetify-loader": "^1.3.0" 29 | }, 30 | "eslintConfig": { 31 | "root": true, 32 | "env": { 33 | "node": true 34 | }, 35 | "extends": [ 36 | "plugin:vue/essential", 37 | "eslint:recommended" 38 | ], 39 | "parserOptions": { 40 | "parser": "babel-eslint" 41 | }, 42 | "rules": {} 43 | }, 44 | "browserslist": [ 45 | "> 1%", 46 | "last 2 versions", 47 | "not dead" 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bezkoder/vuetify-data-table-example/abd37e1affa3f2dc2c061a9881339c7cb4c163ce/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 12 | 13 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 28 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bezkoder/vuetify-data-table-example/abd37e1affa3f2dc2c061a9881339c7cb4c163ce/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | Artboard 46 2 | -------------------------------------------------------------------------------- /src/components/AddTutorial.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 84 | 85 | 90 | -------------------------------------------------------------------------------- /src/components/Tutorial.vue: -------------------------------------------------------------------------------- 1 | 55 | 56 | 125 | 126 | 132 | -------------------------------------------------------------------------------- /src/components/TutorialsList.vue: -------------------------------------------------------------------------------- 1 | 38 | 39 | 121 | 122 | 127 | -------------------------------------------------------------------------------- /src/http-common.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | 3 | export default axios.create({ 4 | baseURL: "http://localhost:8080/api", 5 | headers: { 6 | "Content-type": "application/json" 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import vuetify from './plugins/vuetify' 4 | import router from './router' 5 | 6 | Vue.config.productionTip = false 7 | 8 | new Vue({ 9 | router, 10 | vuetify, 11 | render: h => h(App) 12 | }).$mount('#app') 13 | -------------------------------------------------------------------------------- /src/plugins/vuetify.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Vuetify from 'vuetify/lib'; 3 | 4 | Vue.use(Vuetify); 5 | 6 | export default new Vuetify({ 7 | }); 8 | -------------------------------------------------------------------------------- /src/router.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import Router from "vue-router"; 3 | 4 | Vue.use(Router); 5 | 6 | export default new Router({ 7 | mode: "history", 8 | routes: [ 9 | { 10 | path: "/", 11 | alias: "/tutorials", 12 | name: "tutorials", 13 | component: () => import("./components/TutorialsList") 14 | }, 15 | { 16 | path: "/tutorials/:id", 17 | name: "tutorial-details", 18 | component: () => import("./components/Tutorial") 19 | }, 20 | { 21 | path: "/add", 22 | name: "add", 23 | component: () => import("./components/AddTutorial") 24 | } 25 | ] 26 | }); 27 | -------------------------------------------------------------------------------- /src/services/TutorialDataService.js: -------------------------------------------------------------------------------- 1 | import http from "../http-common"; 2 | 3 | class TutorialDataService { 4 | getAll() { 5 | return http.get("/tutorials"); 6 | } 7 | 8 | get(id) { 9 | return http.get(`/tutorials/${id}`); 10 | } 11 | 12 | create(data) { 13 | return http.post("/tutorials", data); 14 | } 15 | 16 | update(id, data) { 17 | return http.put(`/tutorials/${id}`, data); 18 | } 19 | 20 | delete(id) { 21 | return http.delete(`/tutorials/${id}`); 22 | } 23 | 24 | deleteAll() { 25 | return http.delete(`/tutorials`); 26 | } 27 | 28 | findByTitle(title) { 29 | return http.get(`/tutorials?title=${title}`); 30 | } 31 | } 32 | 33 | export default new TutorialDataService(); -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | transpileDependencies: ["vuetify"], 3 | devServer: { 4 | port: 8081, 5 | }, 6 | }; 7 | --------------------------------------------------------------------------------