├── .babelrc ├── .editorconfig ├── .eslintrc ├── .gitignore ├── .postcssrc ├── README.md ├── package.json ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── components │ ├── DataList.js │ ├── DataModel.js │ ├── PostList.vue │ └── mixins │ │ └── query.js └── main.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@vue/app" 4 | ] 5 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | indent_size = 2 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "extends": [ 4 | "@avalanche/eslint-config", 5 | "plugin:vue/recommended" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Numerous always-ignore extensions 2 | *.diff 3 | *.err 4 | *.log 5 | *.orig 6 | *.rej 7 | *.swo 8 | *.swp 9 | *.tgz 10 | *.vi 11 | *.zip 12 | *~ 13 | 14 | # OS or Editor folders 15 | ._* 16 | .cache 17 | .DS_Store 18 | .idea 19 | .project 20 | .settings 21 | .tmproj 22 | *.esproj 23 | *.sublime-project 24 | *.sublime-workspace 25 | nbproject 26 | Thumbs.db 27 | 28 | # Folders to ignore 29 | dist/* 30 | !dist/_redirects 31 | node_modules 32 | -------------------------------------------------------------------------------- /.postcssrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": { 3 | "autoprefixer": {} 4 | } 5 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Building Renderless Components to Handle CRUD Operations in Vue.js 2 | 3 | [![Patreon](https://img.shields.io/badge/patreon-donate-blue.svg)](https://www.patreon.com/maoberlehner) 4 | [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://paypal.me/maoberlehner) 5 | 6 | This is an example project for the following article: [Building Renderless Components to Handle CRUD Operations in Vue](https://markus.oberlehner.net/blog/building-renderless-components-to-handle-crud-operations-in-vue/) 7 | 8 | ## Build Setup 9 | 10 | ```bash 11 | # Install dependencies. 12 | npm install 13 | 14 | # Serve with hot reload. 15 | npm run serve 16 | 17 | # Build for production with minification. 18 | npm run build 19 | ``` 20 | 21 | ## About 22 | 23 | ### Author 24 | 25 | Markus Oberlehner 26 | Website: https://markus.oberlehner.net 27 | Twitter: https://twitter.com/MaOberlehner 28 | PayPal.me: https://paypal.me/maoberlehner 29 | Patreon: https://www.patreon.com/maoberlehner 30 | 31 | ### License 32 | 33 | MIT 34 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "building-renderless-components-to-handle-crud-operations-in-vue", 3 | "version": "0.1.0", 4 | "author": "Markus Oberlehner", 5 | "homepage": "https://github.com/maoberlehner/building-renderless-components-to-handle-crud-operations-in-vue", 6 | "license": "MIT", 7 | "private": true, 8 | "scripts": { 9 | "serve": "vue-cli-service serve --open", 10 | "build": "vue-cli-service build", 11 | "lint": "vue-cli-service lint" 12 | }, 13 | "dependencies": { 14 | "axios": "^0.18.0", 15 | "vue": "^2.5.16" 16 | }, 17 | "devDependencies": { 18 | "@avalanche/eslint-config": "^2.0.0", 19 | "@vue/cli-plugin-babel": "^3.0.0-beta.10", 20 | "@vue/cli-plugin-eslint": "^3.0.0-beta.10", 21 | "@vue/cli-service": "^3.0.0-beta.10", 22 | "eslint-plugin-import": "^2.12.0", 23 | "eslint-plugin-vue": "^4.5.0", 24 | "node-sass": "^4.7.2", 25 | "sass-loader": "^6.0.6", 26 | "vue-template-compiler": "^2.5.13" 27 | }, 28 | "browserslist": [ 29 | "> 1%", 30 | "last 2 versions", 31 | "not ie <= 8" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maoberlehner/building-renderless-components-to-handle-crud-operations-in-vue/16aa02ddd7428053d1ec0240081ffda43f4f5ecf/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Building Renderless Components to Handle CRUD Operations in Vue.js 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 |