Capital/pages/activity/index.vue

40 lines
915 B
Vue
Raw Normal View History

2024-08-10 09:42:49 +00:00
<template>
<v-container class="content-container mx-auto">
<div class="my-3 mx-[3.5ch]">
<h1 class="text-2xl">Activity</h1>
<span>Explore our official recent activities.</span>
</div>
<v-infinite-scroll :items="items" :onLoad="load">
<template v-for="item in items" :key="item">
<post-item :post="item" />
</template>
</v-infinite-scroll>
</v-container>
</template>
<script setup lang="ts">
2024-08-11 14:26:29 +00:00
useHead({
title: 'Activity',
})
2024-08-10 09:42:49 +00:00
const config = useRuntimeConfig()
const items = ref<any[]>([])
async function load({ done }: any) {
const res = await fetch(`${config.public.solarNetworkApi}/cgi/interactive/posts?take=10&offset=${items.value.length}&realmId=${config.public.solarRealmId}`)
const result = await res.json()
items.value.push(...result.data)
done("ok")
}
</script>
<style scoped>
.content-container {
max-width: 70ch !important;
}
</style>