23 changed files with 22258 additions and 0 deletions
@ -0,0 +1,4 @@ |
|||||
|
> 1% |
||||
|
last 2 versions |
||||
|
not dead |
||||
|
not ie 11 |
@ -0,0 +1,17 @@ |
|||||
|
module.exports = { |
||||
|
root: true, |
||||
|
env: { |
||||
|
node: true |
||||
|
}, |
||||
|
'extends': [ |
||||
|
'plugin:vue/vue3-essential', |
||||
|
'eslint:recommended' |
||||
|
], |
||||
|
parserOptions: { |
||||
|
parser: '@babel/eslint-parser' |
||||
|
}, |
||||
|
rules: { |
||||
|
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', |
||||
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' |
||||
|
} |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
.DS_Store |
||||
|
node_modules |
||||
|
/dist |
||||
|
|
||||
|
|
||||
|
# local env files |
||||
|
.env.local |
||||
|
.env.*.local |
||||
|
|
||||
|
# Log files |
||||
|
npm-debug.log* |
||||
|
yarn-debug.log* |
||||
|
yarn-error.log* |
||||
|
pnpm-debug.log* |
||||
|
|
||||
|
# Editor directories and files |
||||
|
.idea |
||||
|
.vscode |
||||
|
*.suo |
||||
|
*.ntvs* |
||||
|
*.njsproj |
||||
|
*.sln |
||||
|
*.sw? |
@ -0,0 +1,28 @@ |
|||||
|
# dyn_router |
||||
|
|
||||
|
Vygenerovat si data a poté vložit JSON do složky *src* |
||||
|
``` |
||||
|
https://www.mockaroo.com/ |
||||
|
``` |
||||
|
## Project setup |
||||
|
``` |
||||
|
npm install |
||||
|
``` |
||||
|
|
||||
|
### Compiles and hot-reloads for development |
||||
|
``` |
||||
|
npm run serve |
||||
|
``` |
||||
|
|
||||
|
### Compiles and minifies for production |
||||
|
``` |
||||
|
npm run build |
||||
|
``` |
||||
|
|
||||
|
### Lints and fixes files |
||||
|
``` |
||||
|
npm run lint |
||||
|
``` |
||||
|
|
||||
|
### Customize configuration |
||||
|
See [Configuration Reference](https://cli.vuejs.org/config/). |
@ -0,0 +1,5 @@ |
|||||
|
module.exports = { |
||||
|
presets: [ |
||||
|
'@vue/cli-plugin-babel/preset' |
||||
|
] |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
{ |
||||
|
"compilerOptions": { |
||||
|
"target": "es5", |
||||
|
"module": "esnext", |
||||
|
"baseUrl": "./", |
||||
|
"moduleResolution": "node", |
||||
|
"paths": { |
||||
|
"@/*": [ |
||||
|
"src/*" |
||||
|
] |
||||
|
}, |
||||
|
"lib": [ |
||||
|
"esnext", |
||||
|
"dom", |
||||
|
"dom.iterable", |
||||
|
"scripthost" |
||||
|
] |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,25 @@ |
|||||
|
{ |
||||
|
"name": "dyn_router", |
||||
|
"version": "0.1.0", |
||||
|
"private": true, |
||||
|
"scripts": { |
||||
|
"serve": "vue-cli-service serve", |
||||
|
"build": "vue-cli-service build", |
||||
|
"lint": "vue-cli-service lint" |
||||
|
}, |
||||
|
"dependencies": { |
||||
|
"core-js": "^3.8.3", |
||||
|
"vue": "^3.2.13", |
||||
|
"vue-router": "^4.0.3" |
||||
|
}, |
||||
|
"devDependencies": { |
||||
|
"@babel/core": "^7.12.16", |
||||
|
"@babel/eslint-parser": "^7.12.16", |
||||
|
"@vue/cli-plugin-babel": "~5.0.0", |
||||
|
"@vue/cli-plugin-eslint": "~5.0.0", |
||||
|
"@vue/cli-plugin-router": "~5.0.0", |
||||
|
"@vue/cli-service": "~5.0.0", |
||||
|
"eslint": "^7.32.0", |
||||
|
"eslint-plugin-vue": "^8.0.3" |
||||
|
} |
||||
|
} |
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,17 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang=""> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0"> |
||||
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> |
||||
|
<title><%= htmlWebpackPlugin.options.title %></title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<noscript> |
||||
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> |
||||
|
</noscript> |
||||
|
<div id="app"></div> |
||||
|
<!-- built files will be auto injected --> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,30 @@ |
|||||
|
<template> |
||||
|
<nav> |
||||
|
<router-link to="/">Home</router-link> | |
||||
|
<router-link to="/profiles">Profiles</router-link> |
||||
|
</nav> |
||||
|
<router-view/> |
||||
|
</template> |
||||
|
|
||||
|
<style> |
||||
|
#app { |
||||
|
font-family: Avenir, Helvetica, Arial, sans-serif; |
||||
|
-webkit-font-smoothing: antialiased; |
||||
|
-moz-osx-font-smoothing: grayscale; |
||||
|
text-align: center; |
||||
|
color: #2c3e50; |
||||
|
} |
||||
|
|
||||
|
nav { |
||||
|
padding: 30px; |
||||
|
} |
||||
|
|
||||
|
nav a { |
||||
|
font-weight: bold; |
||||
|
color: #2c3e50; |
||||
|
} |
||||
|
|
||||
|
nav a.router-link-exact-active { |
||||
|
color: #42b983; |
||||
|
} |
||||
|
</style> |
After Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,59 @@ |
|||||
|
<template> |
||||
|
<div class="hello"> |
||||
|
<h1>{{ msg }}</h1> |
||||
|
<p> |
||||
|
For a guide and recipes on how to configure / customize this project,<br> |
||||
|
check out the |
||||
|
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>. |
||||
|
</p> |
||||
|
<h3>Installed CLI Plugins</h3> |
||||
|
<ul> |
||||
|
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li> |
||||
|
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li> |
||||
|
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li> |
||||
|
</ul> |
||||
|
<h3>Essential Links</h3> |
||||
|
<ul> |
||||
|
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li> |
||||
|
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li> |
||||
|
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li> |
||||
|
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li> |
||||
|
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li> |
||||
|
</ul> |
||||
|
<h3>Ecosystem</h3> |
||||
|
<ul> |
||||
|
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li> |
||||
|
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li> |
||||
|
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li> |
||||
|
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li> |
||||
|
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li> |
||||
|
</ul> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'HelloWorld', |
||||
|
props: { |
||||
|
msg: String |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<!-- Add "scoped" attribute to limit CSS to this component only --> |
||||
|
<style scoped> |
||||
|
h3 { |
||||
|
margin: 40px 0 0; |
||||
|
} |
||||
|
ul { |
||||
|
list-style-type: none; |
||||
|
padding: 0; |
||||
|
} |
||||
|
li { |
||||
|
display: inline-block; |
||||
|
margin: 0 10px; |
||||
|
} |
||||
|
a { |
||||
|
color: #42b983; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,5 @@ |
|||||
|
import { createApp } from 'vue' |
||||
|
import App from './App.vue' |
||||
|
import router from './router' |
||||
|
|
||||
|
createApp(App).use(router).mount('#app') |
@ -0,0 +1,20 @@ |
|||||
|
[{"id":1,"appname":"Cardguard","fullname":"Abbie Gremain","email":"agremain0@unesco.org","gender":"Female","telnumber":"777-81-3693","favcolor":"Indigo"}, |
||||
|
{"id":2,"appname":"Flexidy","fullname":"Heida Gleder","email":"hgleder1@slashdot.org","gender":"Female","telnumber":"419-25-1742","favcolor":"Mauv"}, |
||||
|
{"id":3,"appname":"Tin","fullname":"Bail Wookey","email":"bwookey2@sciencedirect.com","gender":"Male","telnumber":"812-16-0065","favcolor":"Pink"}, |
||||
|
{"id":4,"appname":"Otcom","fullname":"Franklin Fields","email":"ffields3@reference.com","gender":"Male","telnumber":"521-44-3501","favcolor":"Blue"}, |
||||
|
{"id":5,"appname":"Zathin","fullname":"Robb Sturgess","email":"rsturgess4@house.gov","gender":"Male","telnumber":"538-43-0072","favcolor":"Turquoise"}, |
||||
|
{"id":6,"appname":"Fix San","fullname":"Margit Iley","email":"miley5@bloglovin.com","gender":"Female","telnumber":"337-42-7875","favcolor":"Teal"}, |
||||
|
{"id":7,"appname":"Fixflex","fullname":"Rolando Hoggins","email":"rhoggins6@indiegogo.com","gender":"Male","telnumber":"400-26-8553","favcolor":"Yellow"}, |
||||
|
{"id":8,"appname":"Cardify","fullname":"Bryce Baird","email":"bbaird7@flickr.com","gender":"Male","telnumber":"665-54-8662","favcolor":"Crimson"}, |
||||
|
{"id":9,"appname":"Zaam-Dox","fullname":"Alli Menchenton","email":"amenchenton8@hp.com","gender":"Female","telnumber":"853-01-9105","favcolor":"Fuscia"}, |
||||
|
{"id":10,"appname":"Tresom","fullname":"Miran Bedlington","email":"mbedlington9@alibaba.com","gender":"Female","telnumber":"601-80-0043","favcolor":"Maroon"}, |
||||
|
{"id":11,"appname":"Stim","fullname":"Lowrance O'Henehan","email":"lohenehana@yelp.com","gender":"Male","telnumber":"217-13-6530","favcolor":"Puce"}, |
||||
|
{"id":12,"appname":"Stronghold","fullname":"Tommy McElrea","email":"tmcelreab@mysql.com","gender":"Male","telnumber":"237-11-5408","favcolor":"Indigo"}, |
||||
|
{"id":13,"appname":"Treeflex","fullname":"Patrizia Heinz","email":"pheinzc@cornell.edu","gender":"Female","telnumber":"141-81-3560","favcolor":"Fuscia"}, |
||||
|
{"id":14,"appname":"Fixflex","fullname":"Lilas Godball","email":"lgodballd@com.com","gender":"Female","telnumber":"492-54-8142","favcolor":"Pink"}, |
||||
|
{"id":15,"appname":"Duobam","fullname":"Alonzo Gawith","email":"agawithe@youtube.com","gender":"Male","telnumber":"295-03-7083","favcolor":"Fuscia"}, |
||||
|
{"id":16,"appname":"Gembucket","fullname":"Fulton Yokel","email":"fyokelf@businesswire.com","gender":"Male","telnumber":"122-11-9861","favcolor":"Orange"}, |
||||
|
{"id":17,"appname":"Trippledex","fullname":"Padraig Salomon","email":"psalomong@jalbum.net","gender":"Male","telnumber":"238-32-3913","favcolor":"Crimson"}, |
||||
|
{"id":18,"appname":"Opela","fullname":"Valaria Rutgers","email":"vrutgersh@nymag.com","gender":"Female","telnumber":"265-24-4807","favcolor":"Green"}, |
||||
|
{"id":19,"appname":"Tin","fullname":"Melitta Petkens","email":"mpetkensi@fc2.com","gender":"Female","telnumber":"667-81-6641","favcolor":"Red"}, |
||||
|
{"id":20,"appname":"Cardify","fullname":"Maire Rameau","email":"mrameauj@artisteer.com","gender":"Female","telnumber":"294-96-6981","favcolor":"Purple"}] |
@ -0,0 +1,40 @@ |
|||||
|
import { createRouter, createWebHistory } from 'vue-router' |
||||
|
import HomeView from '../views/HomeView.vue' |
||||
|
import ProfilesView from '../views/ProfilesView.vue' |
||||
|
import ProfileDetailView from '../views/ProfileDetailView.vue' |
||||
|
import ErrorView from '../views/ErrorView.vue' |
||||
|
const routes = [ |
||||
|
{ |
||||
|
path: '/', |
||||
|
name: 'home', |
||||
|
component: HomeView |
||||
|
}, |
||||
|
{ |
||||
|
path: '/profiles', |
||||
|
name: 'Profiles', |
||||
|
component: ProfilesView |
||||
|
}, |
||||
|
{ |
||||
|
path: '/profiles/:id', |
||||
|
name: 'ProfileDetail', |
||||
|
component: ProfileDetailView, |
||||
|
props: route => ({id: parseInt(route.params.id)}) |
||||
|
}, |
||||
|
{ |
||||
|
path: '/error', |
||||
|
name: 'Error', |
||||
|
component: ErrorView |
||||
|
}, |
||||
|
{ //přesměrování pro jakoukoliv neplatnou cestu
|
||||
|
path: '/:catchAll(.*)', |
||||
|
redirect: '/error', |
||||
|
component: ProfilesView |
||||
|
}, |
||||
|
] |
||||
|
|
||||
|
const router = createRouter({ |
||||
|
history: createWebHistory(process.env.BASE_URL), |
||||
|
routes |
||||
|
}) |
||||
|
|
||||
|
export default router |
@ -0,0 +1,13 @@ |
|||||
|
<template> |
||||
|
<div class="home"> |
||||
|
<h1>ERROR 404: PAGE NOT FOUND</h1> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
// @ is an alias to /src |
||||
|
|
||||
|
export default { |
||||
|
name: 'ErrorView', |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,18 @@ |
|||||
|
<template> |
||||
|
<div class="home"> |
||||
|
<img alt="Vue logo" src="../assets/logo.png"> |
||||
|
<HelloWorld msg="Welcome to Your Vue.js App"/> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
// @ is an alias to /src |
||||
|
import HelloWorld from '@/components/HelloWorld.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: 'HomeView', |
||||
|
components: { |
||||
|
HelloWorld |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,36 @@ |
|||||
|
<template> |
||||
|
<div class="profile" v-if="profile"> |
||||
|
<h1>Profile Detail: {{ profile.id }}</h1> |
||||
|
<h2> {{ profile.appname }} </h2> |
||||
|
<h3> Name: {{ profile.fullname }}</h3> |
||||
|
<p>e-mail: {{ profile.email }}</p> |
||||
|
<p>Gender: {{ profile.gender }}</p> |
||||
|
<p>phone: {{ profile.telnumber }}</p> |
||||
|
<p>fav. color: {{ profile.favcolor }}</p> |
||||
|
</div> |
||||
|
<p><router-link to="/profiles">BACK</router-link></p> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import profilesData from "../profiles.json" |
||||
|
|
||||
|
export default { |
||||
|
props: { |
||||
|
id: { |
||||
|
type: Number, |
||||
|
required: true |
||||
|
} |
||||
|
}, |
||||
|
computed: {//computed ->vždy se dopočítává |
||||
|
profile() { |
||||
|
return profilesData.find(profile => profile.id === parseInt(this.id)) |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
if (!this.profile) { |
||||
|
this.$router.push("/error"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
@ -0,0 +1,36 @@ |
|||||
|
<template> |
||||
|
<div class="Profiles"> |
||||
|
<h1>List of profiles</h1> |
||||
|
<ul> |
||||
|
<li v-for="profile in profiles" :key="profile.id"> |
||||
|
<router-link :to="`/profiles/${profile.id}`"> |
||||
|
{{profile.id}} - {{profile.appname}} |
||||
|
</router-link> |
||||
|
</li> |
||||
|
</ul> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import profilesData from "../profiles.json" |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
profiles: profilesData |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
ul { |
||||
|
list-style-type: none; |
||||
|
padding: 0px; |
||||
|
} |
||||
|
li { |
||||
|
padding: 3px 0px; |
||||
|
} |
||||
|
|
||||
|
</style> |
@ -0,0 +1,4 @@ |
|||||
|
const { defineConfig } = require('@vue/cli-service') |
||||
|
module.exports = defineConfig({ |
||||
|
transpileDependencies: true |
||||
|
}) |
File diff suppressed because it is too large
@ -0,0 +1,5 @@ |
|||||
|
{ |
||||
|
"dependencies": { |
||||
|
"@vue/cli": "^5.0.8" |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue