├── .browserslistrc ├── .eslintrc.js ├── .gitignore ├── README.md ├── babel.config.js ├── package-lock.json ├── package.json ├── public ├── favicon.ico └── index.html └── src ├── App.vue ├── assets └── logo.png ├── components └── HelloWorld.vue ├── main.js ├── router └── index.js ├── store └── index.js └── views ├── Home.vue └── Recipe.vue /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/vue3-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 | 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 | # yt 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 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | npm run lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yt", 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 | "core-js": "^3.6.5", 12 | "vue": "^3.0.0", 13 | "vue-router": "^4.0.0-0", 14 | "vuex": "^4.0.0-0" 15 | }, 16 | "devDependencies": { 17 | "@vue/cli-plugin-babel": "~4.5.0", 18 | "@vue/cli-plugin-eslint": "~4.5.0", 19 | "@vue/cli-plugin-router": "~4.5.0", 20 | "@vue/cli-plugin-vuex": "~4.5.0", 21 | "@vue/cli-service": "~4.5.0", 22 | "@vue/compiler-sfc": "^3.0.0", 23 | "babel-eslint": "^10.1.0", 24 | "eslint": "^6.7.2", 25 | "eslint-plugin-vue": "^7.0.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TylerPottsDev/yt-vue-recipe-app/22582540f9befaafb72f3638ab82d45bd659fde7/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 | 4 | 5 | 34 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TylerPottsDev/yt-vue-recipe-app/22582540f9befaafb72f3638ab82d45bd659fde7/src/assets/logo.png -------------------------------------------------------------------------------- /src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 43 | 44 | 45 | 61 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import store from './store' 5 | 6 | createApp(App).use(store).use(router).mount('#app') 7 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHistory } from 'vue-router' 2 | import Home from '../views/Home.vue' 3 | 4 | const routes = [ 5 | { 6 | path: '/', 7 | name: 'Home', 8 | component: Home 9 | }, 10 | { 11 | path: '/recipe/:slug', 12 | name: 'Recipe', 13 | component: () => import('../views/Recipe.vue') 14 | } 15 | ] 16 | 17 | const router = createRouter({ 18 | history: createWebHistory(process.env.BASE_URL), 19 | routes 20 | }) 21 | 22 | export default router 23 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import { createStore } from 'vuex' 2 | 3 | export default createStore({ 4 | state: { 5 | recipes: [ 6 | { 7 | slug: 'katsu-curry', 8 | title: 'Katsu Curry', 9 | description: 'A delicious curry made with chicken, potatoes, and a special sauce', 10 | ingredients: [ 11 | '1 tablespoon olive oil', 12 | '1 onion, chopped', 13 | '2 cloves garlic, chopped', 14 | '1 tablespoon curry powder', 15 | ], 16 | method: [ 17 | 'Heat oil in a large skillet over medium heat.', 18 | 'Add onion and garlic and cook, stirring often, until softened, about 5 minutes.', 19 | 'Add curry powder and cook, stirring, until fragrant, about 1 minute.', 20 | 'Add chicken and potatoes and cook, stirring, until heated through, about 5 minutes.', 21 | ] 22 | }, 23 | { 24 | slug: 'ramen-noodle-soup', 25 | title: 'Ramen noodle soup', 26 | description: 'A delicious curry made with chicken, potatoes, and a special sauce', 27 | ingredients: [ 28 | '1 tablespoon olive oil', 29 | '1 onion, chopped', 30 | '2 cloves garlic, chopped', 31 | '1 tablespoon curry powder', 32 | ], 33 | method: [ 34 | 'Heat oil in a large skillet over medium heat.', 35 | 'Add onion and garlic and cook, stirring often, until softened, about 5 minutes.', 36 | 'Add curry powder and cook, stirring, until fragrant, about 1 minute.', 37 | 'Add chicken and potatoes and cook, stirring, until heated through, about 5 minutes.', 38 | ] 39 | } 40 | ] 41 | }, 42 | mutations: { 43 | ADD_RECIPE (state, recipe) { 44 | state.recipes.push(recipe) 45 | } 46 | } 47 | }) 48 | -------------------------------------------------------------------------------- /src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 54 | 55 | 118 | 119 | -------------------------------------------------------------------------------- /src/views/Recipe.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 40 | 41 | --------------------------------------------------------------------------------