31 lines
519 B
Vue
31 lines
519 B
Vue
<script setup>
|
|
import Wish from '../components/Wish.vue';
|
|
import {ref, onMounted} from 'vue';
|
|
import axios from 'axios';
|
|
|
|
let interval;
|
|
|
|
const wishes = ref([]);
|
|
|
|
const call = () => {
|
|
axios
|
|
.get('/api/get_wishes')
|
|
.then(response => {
|
|
wishes.value = response.data;
|
|
})
|
|
}
|
|
|
|
onMounted(() => {
|
|
call();
|
|
interval = setInterval(call, 10000);
|
|
})
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<body>
|
|
<template v-for="wish in wishes">
|
|
<Wish :wish="wish"/>
|
|
</template>
|
|
</body>
|
|
</template> |