added store state for json
This commit is contained in:
2
dist/assets/index-9e856be7.js
vendored
2
dist/assets/index-9e856be7.js
vendored
File diff suppressed because one or more lines are too long
2
dist/assets/index-fc3f27a6.js
vendored
Normal file
2
dist/assets/index-fc3f27a6.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
dist/assets/logo-d921ef81.png
vendored
Normal file
BIN
dist/assets/logo-d921ef81.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 273 KiB |
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -1 +1 @@
|
|||||||
<!doctype html><html lang="en"><head><meta charset="UTF-8"><link rel="icon" href="./favicon.ico"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Gym Tracker</title><script type="module" crossorigin src="./assets/index-9e856be7.js"></script></head><body><div id="app"></div></body></html>
|
<!doctype html><html lang="en"><head><meta charset="UTF-8"><link rel="icon" href="./logo.ico"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Gym Tracker</title><script type="module" crossorigin src="./assets/index-fc3f27a6.js"></script></head><body><div id="app"></div></body></html>
|
||||||
BIN
dist/logo.ico
vendored
Normal file
BIN
dist/logo.ico
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 162 KiB |
57
package-lock.json
generated
57
package-lock.json
generated
@@ -16,6 +16,7 @@
|
|||||||
"vue-router": "^4.1.6"
|
"vue-router": "^4.1.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
"@rushstack/eslint-patch": "^1.2.0",
|
"@rushstack/eslint-patch": "^1.2.0",
|
||||||
"@vitejs/plugin-vue": "^4.0.0",
|
"@vitejs/plugin-vue": "^4.0.0",
|
||||||
"@vue/eslint-config-prettier": "^7.1.0",
|
"@vue/eslint-config-prettier": "^7.1.0",
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
"eslint-plugin-vue": "^9.9.0",
|
"eslint-plugin-vue": "^9.9.0",
|
||||||
"jsdom": "^21.1.0",
|
"jsdom": "^21.1.0",
|
||||||
"prettier": "^2.8.4",
|
"prettier": "^2.8.4",
|
||||||
"sass": "^1.62.0",
|
"sass": "^1.62.1",
|
||||||
"vite": "^4.1.4",
|
"vite": "^4.1.4",
|
||||||
"vitest": "^0.29.1"
|
"vitest": "^0.29.1"
|
||||||
}
|
}
|
||||||
@@ -548,6 +549,48 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@rollup/plugin-json": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@rollup/pluginutils": "^5.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"rollup": "^1.20.0||^2.0.0||^3.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"rollup": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@rollup/plugin-json/node_modules/@rollup/pluginutils": {
|
||||||
|
"version": "5.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz",
|
||||||
|
"integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@types/estree": "^1.0.0",
|
||||||
|
"estree-walker": "^2.0.2",
|
||||||
|
"picomatch": "^2.3.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"rollup": "^1.20.0||^2.0.0||^3.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"rollup": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@rollup/pluginutils": {
|
"node_modules/@rollup/pluginutils": {
|
||||||
"version": "4.2.1",
|
"version": "4.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",
|
||||||
@@ -590,6 +633,12 @@
|
|||||||
"@types/chai": "*"
|
"@types/chai": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/estree": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "18.15.11",
|
"version": "18.15.11",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz",
|
||||||
@@ -3300,9 +3349,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/sass": {
|
"node_modules/sass": {
|
||||||
"version": "1.62.0",
|
"version": "1.62.1",
|
||||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.62.0.tgz",
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.62.1.tgz",
|
||||||
"integrity": "sha512-Q4USplo4pLYgCi+XlipZCWUQz5pkg/ruSSgJ0WRDSb/+3z9tXUOkQ7QPYn4XrhZKYAK4HlpaQecRwKLJX6+DBg==",
|
"integrity": "sha512-NHpxIzN29MXvWiuswfc1W3I0N8SXBd8UR26WntmDlRYf0bSADnwnOjsyMZ3lMezSlArD33Vs3YFhp7dWvL770A==",
|
||||||
"devOptional": true,
|
"devOptional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chokidar": ">=3.0.0 <4.0.0",
|
"chokidar": ">=3.0.0 <4.0.0",
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
"vue-router": "^4.1.6"
|
"vue-router": "^4.1.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
"@rushstack/eslint-patch": "^1.2.0",
|
"@rushstack/eslint-patch": "^1.2.0",
|
||||||
"@vitejs/plugin-vue": "^4.0.0",
|
"@vitejs/plugin-vue": "^4.0.0",
|
||||||
"@vue/eslint-config-prettier": "^7.1.0",
|
"@vue/eslint-config-prettier": "^7.1.0",
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export {default as gymTrackerLogo} from './gymTrackerLogo.png';
|
export {default as gymTrackerLogo} from './gymTrackerLogo.png';
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
"muscle" [
|
||||||
"muscle": [
|
|
||||||
{
|
{
|
||||||
"name": "Legs",
|
"name": "Legs",
|
||||||
"exercises":
|
"exercises":
|
||||||
@@ -761,4 +760,4 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
export default muscleExercise;
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<router-link to="/Muscles/Chest" class="nav-item nav-link">Chest</router-link>
|
<router-link to="/Muscles/Chest" class="nav-item nav-link">Chest</router-link>
|
||||||
<router-link to="/Muscles/Shoulder" class="nav-item nav-link">Shoulder</router-link>
|
<router-link to="/Muscles/Shoulder" class="nav-item nav-link">Shoulder</router-link>
|
||||||
<router-link to="/Muscles/Triceps" class="nav-item nav-link">Triceps</router-link>
|
<router-link to="/Muscles/Triceps" class="nav-item nav-link">Triceps</router-link>
|
||||||
<router-link to="/Muscles/Bicepts" class="nav-item nav-link">Bicepts</router-link>
|
<router-link to="/Muscles/Biceps" class="nav-item nav-link">Biceps</router-link>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
.logo img {
|
.logo img {
|
||||||
width: 30%;
|
width: 20%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin-left: 1rem;
|
margin-left: 1rem;
|
||||||
}
|
}
|
||||||
|
|||||||
24
src/stores/post.js
Normal file
24
src/stores/post.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import {defineStore} from 'pinia'
|
||||||
|
import muscleExercise from '../assets/muscleExercise';
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
export const usePostStore = defineStore('post', () => {
|
||||||
|
const postList = ref([])
|
||||||
|
const currentPost = ref(null)
|
||||||
|
const error = ref(null)
|
||||||
|
|
||||||
|
async function fetchMuscleExercise() {
|
||||||
|
postList.value = muscleExercise
|
||||||
|
error.value = []
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
postList,
|
||||||
|
currentPost,
|
||||||
|
error,
|
||||||
|
fetchMuscleExercise
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
export default usePostStore
|
||||||
@@ -1,24 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="legs">
|
<div class="legs">
|
||||||
<h1>Legs</h1>
|
<h1>Legs</h1>
|
||||||
<h2>Search</h2>
|
<div v-for="post in post.postList">
|
||||||
|
<h2>{{post.exercise}}</h2>
|
||||||
|
<p>{{post.body}}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { usePostStore } from '@/stores/post.js'
|
||||||
|
import { onMounted } from 'vue';
|
||||||
|
|
||||||
</script>
|
const post = usePostStore()
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
post.fetchMuscleExercise()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* @media (min-width: 1024px) {
|
</style>
|
||||||
.about {
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
align-items: right;
|
|
||||||
}
|
|
||||||
} */
|
|
||||||
.legs {
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user