├── .browserslistrc ├── .editorconfig ├── .eslintrc.js ├── .gitignore ├── README.md ├── babel.config.js ├── jest.config.js ├── package.json ├── postcss.config.js ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── assets │ ├── logo.png │ └── logo.svg ├── components │ ├── ActivitiesList.vue │ ├── Activity.vue │ └── AddActivityField.vue ├── main.js ├── plugins │ ├── vee-validate.js │ └── vuetify.js └── store.js ├── tests └── unit │ └── .eslintrc.js └── vue.config.js /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not ie <= 8 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{js,jsx,ts,tsx,vue}] 2 | indent_style = space 3 | indent_size = 2 4 | trim_trailing_whitespace = true 5 | insert_final_newline = true 6 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | '@vue/standard' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 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 | package-lock.json 12 | yarn.lock 13 | yarn-debug.log* 14 | yarn-error.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 | # Vue ToDo List 2 | 3 | A sample app to demonstrate Vue + Vuex + Vuetify + Vee-Validate features. 4 | See [demo](https://alexander-elgin.github.io/vue-todo-list/) 5 | 6 | ## Project setup 7 | ``` 8 | yarn install 9 | ``` 10 | 11 | ### Compiles and hot-reloads for development 12 | ``` 13 | yarn run serve 14 | ``` 15 | 16 | ### Compiles and minifies for production 17 | ``` 18 | yarn run build 19 | ``` 20 | 21 | ### Run your tests 22 | ``` 23 | yarn run test 24 | ``` 25 | 26 | ### Lints and fixes files 27 | ``` 28 | yarn run lint 29 | ``` 30 | 31 | ### Run your unit tests 32 | ``` 33 | yarn run test:unit 34 | ``` 35 | 36 | ### Customize configuration 37 | See [Configuration Reference](https://cli.vuejs.org/config/). 38 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | moduleFileExtensions: [ 3 | 'js', 4 | 'jsx', 5 | 'json', 6 | 'vue' 7 | ], 8 | transform: { 9 | '^.+\\.vue$': 'vue-jest', 10 | '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', 11 | '^.+\\.jsx?$': 'babel-jest' 12 | }, 13 | moduleNameMapper: { 14 | '^@/(.*)$': '/src/$1' 15 | }, 16 | snapshotSerializers: [ 17 | 'jest-serializer-vue' 18 | ], 19 | testMatch: [ 20 | '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' 21 | ], 22 | testURL: 'http://localhost/' 23 | } 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-final", 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 | "test:unit": "vue-cli-service test:unit" 10 | }, 11 | "dependencies": { 12 | "vee-validate": "^2.1.4", 13 | "vue": "^2.5.17", 14 | "vuetify": "^1.3.0", 15 | "vuex": "^3.0.1" 16 | }, 17 | "devDependencies": { 18 | "@vue/cli-plugin-babel": "^3.2.0", 19 | "@vue/cli-plugin-eslint": "^3.2.0", 20 | "@vue/cli-plugin-unit-jest": "^3.2.0", 21 | "@vue/cli-service": "^3.2.0", 22 | "@vue/eslint-config-standard": "^4.0.0", 23 | "@vue/test-utils": "^1.0.0-beta.20", 24 | "babel-core": "7.0.0-bridge.0", 25 | "babel-eslint": "^10.0.1", 26 | "babel-jest": "^23.6.0", 27 | "eslint": "^5.8.0", 28 | "eslint-plugin-vue": "^5.0.0-0", 29 | "stylus": "^0.54.5", 30 | "stylus-loader": "^3.0.2", 31 | "vue-cli-plugin-vuetify": "^0.4.6", 32 | "vue-template-compiler": "^2.5.17", 33 | "vuetify-loader": "^1.0.5" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexander-elgin/vue-todo-list/030c2c09ff6e9d6ef444a815be25c352b431290f/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Todo List 9 | 10 | 11 | 12 | 13 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 25 | 26 | 28 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexander-elgin/vue-todo-list/030c2c09ff6e9d6ef444a815be25c352b431290f/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | Artboard 46 2 | -------------------------------------------------------------------------------- /src/components/ActivitiesList.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /src/components/Activity.vue: -------------------------------------------------------------------------------- 1 | 45 | 46 | 70 | 71 | 76 | -------------------------------------------------------------------------------- /src/components/AddActivityField.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 53 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import './plugins/vee-validate' 3 | import './plugins/vuetify' 4 | import App from './App.vue' 5 | import store from './store' 6 | 7 | Vue.config.productionTip = false 8 | 9 | new Vue({ 10 | store, 11 | render: h => h(App) 12 | }).$mount('#app') 13 | -------------------------------------------------------------------------------- /src/plugins/vee-validate.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VeeValidate from 'vee-validate' 3 | 4 | Vue.use(VeeValidate) 5 | -------------------------------------------------------------------------------- /src/plugins/vuetify.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuetify from 'vuetify/lib' 3 | import 'vuetify/src/stylus/app.styl' 4 | 5 | Vue.use(Vuetify, { 6 | iconfont: 'md' 7 | }) 8 | -------------------------------------------------------------------------------- /src/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | Vue.use(Vuex) 5 | 6 | const STORAGE_KEY = 'activities' 7 | 8 | export default new Vuex.Store({ 9 | state: { 10 | activities: JSON.parse(window.localStorage.getItem(STORAGE_KEY) || '[]') 11 | }, 12 | actions: { 13 | add ({ commit }, title) { 14 | commit('add', { 15 | title, 16 | done: false 17 | }) 18 | }, 19 | remove ({ commit }, activity) { 20 | commit('remove', { 21 | activity 22 | }) 23 | }, 24 | toggle ({ commit }, activity) { 25 | commit('toggle', { 26 | activity, 27 | done: !activity.done 28 | }) 29 | } 30 | }, 31 | mutations: { 32 | add (state, activity) { 33 | state.activities.push(activity) 34 | }, 35 | remove (state, { activity }) { 36 | state.activities.splice(state.activities.indexOf(activity), 1) 37 | }, 38 | toggle (state, { activity, done }) { 39 | activity.done = done 40 | } 41 | }, 42 | plugins: [ 43 | store => { 44 | store.subscribe((mutation, { activities }) => { 45 | window.localStorage.setItem(STORAGE_KEY, JSON.stringify(activities)) 46 | }) 47 | } 48 | ] 49 | }) 50 | -------------------------------------------------------------------------------- /tests/unit/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | jest: true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | publicPath: './' 3 | }; 4 | --------------------------------------------------------------------------------