aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/components/HomeHeader.vue
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-05-24 10:49:41 +0200
committerHampusM <hampus@hampusmat.com>2021-05-24 10:49:41 +0200
commit518bd58c5aba1a6eaa645074f3ae2d780c45f6dc (patch)
treea99acd3b434422e019bc76064ad0798c8472f07d /src/frontend/components/HomeHeader.vue
parent21e52ba2fa323e8aebf291882083c1eca9f6a5af (diff)
Restructured the whole project & added Nodemon and Concurrently
Diffstat (limited to 'src/frontend/components/HomeHeader.vue')
-rw-r--r--src/frontend/components/HomeHeader.vue39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/frontend/components/HomeHeader.vue b/src/frontend/components/HomeHeader.vue
new file mode 100644
index 0000000..f0366a3
--- /dev/null
+++ b/src/frontend/components/HomeHeader.vue
@@ -0,0 +1,39 @@
+<template>
+ <div class="row mx-0">
+ <div id="header" class="col d-flex mt-3 ms-2">
+ <div class="d-inline ms-3">
+ <span id="title" class="fs-1">{{ title }}</span>
+ <p id="about" class="mb-3 fs-4">
+ {{ about }}
+ </p>
+ </div>
+ </div>
+ </div>
+</template>
+
+<script>
+import { watch, reactive, toRefs } from "vue";
+
+export default {
+ name: "HomeHeader",
+ setup()
+ {
+ const state = reactive({ title: String, about: String });
+
+ watch(() =>
+ {
+ fetch(`http://localhost:1337/api/v1/info`)
+ .then((res) => res.json())
+ .then((data) =>
+ {
+ state.title = data["data"]["title"],
+ state.about = data["data"]["about"]
+ });
+ });
+
+ return {
+ ... toRefs(state)
+ };
+ }
+}
+</script> \ No newline at end of file