add axios, some db changes

This commit is contained in:
2026-09-19 16:02:43 +02:00
parent 096c3b0fd5
commit 99acf30fb9
7 changed files with 388 additions and 10 deletions
+36 -5
View File
@@ -1,14 +1,45 @@
<script lang="ts" setup>
<script setup>
import Wish from '../components/Wish.vue';
import {ref, onMounted} from 'vue';
import axios from 'axios';
</script>
<script lang="ts">
const wishes = ref();
<script>
let interval;
export default {
setup()
{
const wishes = ref([])
return {
wishes,
}
},
mounted() {
const call = () => {
axios
.get('/api/get_wishes')
.then(response => {
this.wishes = response.data;
})
}
call();
interval = setInterval(call, 30000);
}
}
</script>
<template>
<body>
<Wish rune="1" color="200"/>
<Wish type="1" rune="1"/>
<template v-for="wish in wishes">
<Wish :rune="wish.rune" :type="wish.type" :color="wish.color"/>
{{ wish.title }}
</template>
</body>
</template>