Files
wishboard/resources/js/pages/HomeView.vue
T
2026-09-19 16:02:43 +02:00

45 lines
876 B
Vue

<script setup>
import Wish from '../components/Wish.vue';
import {ref, onMounted} from 'vue';
import axios from 'axios';
</script>
<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>
<template v-for="wish in wishes">
<Wish :rune="wish.rune" :type="wish.type" :color="wish.color"/>
{{ wish.title }}
</template>
</body>
</template>