Session 2

This commit is contained in:
marcgauch committed 2023-01-16 21:57:08 +01:00
1 parent da0c4e925d
commit c335f5a31f
24 files changed
+1678 -51

No files matched your search

Binary file not shown.
+28
View File
@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
/cypress/videos/
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
+3
View File
@@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
}
+29
View File
@@ -0,0 +1,29 @@
# exam
This template should help get you started developing with Vue 3 in Vite.
## Recommended IDE Setup
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
## Customize configuration
See [Vite Configuration Reference](https://vitejs.dev/config/).
## Project Setup
```sh
npm install
```
### Compile and Hot-Reload for Development
```sh
npm run dev
```
### Compile and Minify for Production
```sh
npm run build
```
+13
View File
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://unpkg.com/chota@latest">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Exam App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
File diff suppressed because it is too large. Load diff
+17
View File
@@ -0,0 +1,17 @@
{
"name": "exam",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.2.45"
},
"devDependencies": {
"@vitejs/plugin-vue": "^3.2.0",
"vite": "^3.2.4"
}
}
@@ -0,0 +1,37 @@
<!--
Task: Outsource the "Articles" from this News Site in a child component including Props
for the header and Paragraph Text.
The data for this Articles should come from the Parent SFC.
-->
<template>
<section class="container" id="app">
<!-- not part of the assignment-->
<Title title="News of the day" />
<div class="row">
<div class="col">
<Article header="Winter is coming!" text="Get your gear ready." />
</div>
<div class="col">
<Article header="Vue.js" text="Version 14 out now!" />
</div>
<div class="col">
<Article header="Chur" text="Swiss town out of Cheese!" />
</div>
<div class="col">
<Article header="FHGR" text="Data leaked from University." />
</div>
</div>
</section>
</template>
<script>
import Article from "./components/Article.vue";
import Title from "./components/Title.vue";
export default {
components: {
Article,
Title,
},
};
</script>
+37
View File
@@ -0,0 +1,37 @@
<!--
Task: Outsource the "Articles" from this News Site in a child component including Props
for the header and Paragraph Text.
The data for this Articles should come from the Parent SFC.
-->
<template>
<section class="container" id="app">
<Title title="News of the day" />
<div class="row">
<div class="col" v-for="article in articles">
<Article v-bind:header="article.header" :text="article.text"></Article>
</div>
</div>
</section>
</template>
<script>
import Article from "./components/Article.vue";
import Title from "./components/Title.vue";
export default {
data() {
return {
articles: [
{ header: "Winter is coming!", text: "Get your gear ready." },
{ header: "Vue.js", text: "Version 14 out now!" },
{ header: "Chur", text: "Swiss town out of Cheese!" },
{ header: "FHGR", text: "Data leaked from University." },
],
};
},
components: {
Article,
Title,
},
};
</script>
@@ -0,0 +1,14 @@
<template>
<div class="card">
<header>
<h4>{{ header }}</h4>
</header>
<p>{{ text }}</p>
</div>
</template>
<script>
export default {
props: ["header", "text"],
};
</script>
@@ -0,0 +1,14 @@
<template>
<div>
<h1>{{ title }}</h1>
<h3>the best news</h3>
<a href="mailto:me@hotmail.com">contact me</a>
<hr />
</div>
</template>
<script>
export default {
props: ["title"],
};
</script>
+5
View File
@@ -0,0 +1,5 @@
import { createApp } from 'vue'
import App from './App.vue'
const app = createApp(App);
app.mount('#app');
@@ -0,0 +1,14 @@
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})
+6
View File
@@ -0,0 +1,6 @@
{
"name": "task-4",
"lockfileVersion": 2,
"requires": true,
"packages": {}
}