add main page

This commit is contained in:
2025-05-18 22:59:07 +07:00
parent 5212c44a0a
commit 3bc331f742
6 changed files with 106 additions and 39 deletions
+50
View File
@@ -0,0 +1,50 @@
<script setup lang="ts">
import { ref } from 'vue';
type Application = {
name: string
}
type Team = {
name: string
spendTime: number
applications: Application[]
}
type Teams = {
teams: Team[]
}
const teams = ref<Teams>({teams: []})
function getTeams() {
fetch(
"/teams"
)
.then(response => response.json())
.then(data => {
teams.value = data
})
.catch(error => {
console.error('Ошибка:', error)
});
}
getTeams()
</script>
<template>
<div class="header-block">
Вечерний детектив
</div>
<div v-for="team in teams.teams" :key="team.name">
{{ team.name }}
{{ team.spendTime }}
{{ team.applications }}
</div>
</template>
<style scoped>
</style>