blob: dc266aae5281463fc151b78757a8b3cb54388220 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
<template>
<div id="header">
<span id="title" class="fs-1">{{ title }}</span>
<p id="about" class="fs-4">
{{ about }}
</p>
</div>
</template>
<script lang="ts">
import { defineComponent, ref } from "vue";
import { Info } from "api";
export default defineComponent({
name: "HomeHeader",
setup() {
const title = ref("");
const about = ref("");
async function fetchInfo() {
const info: Info = (await (await fetch(`${window.location.protocol}//${window.location.host}/api/v1/info`)).json()).data;
title.value = info.title;
about.value = info.about;
};
return { title, about, fetchInfo };
},
mounted() {
this.fetchInfo();
}
});
</script>
<style lang="scss" scoped>
@use "../scss/mixins";
@use "../scss/fonts";
#header {
@include mixins.header;
flex-direction: column;
}
#title {
font-family: fonts.$title;
font-weight: 300;
line-height: 0.6;
}
#about {
font-weight: 300;
padding-left: 1px;
}
</style>
|