多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.3 KiB

<script setup lang="ts">
const props = defineProps<{
type: 'github' | 'cloud'
}>()
const { loadFeed, githubFeed, isErrorOccurred, cloudFeed } = useProductFeed()
const scrollContainer = ref<HTMLElement>()
const { isLoading } = useInfiniteScroll(
scrollContainer,
async () => {
if (isLoading.value) return
await loadFeed({
type: props.type,
loadMore: true,
})
},
{ distance: 4 },
)
2 months ago
const feeds = computed(() => {
return props.type === 'github' ? githubFeed.value : cloudFeed.value
})
</script>
<template>
<div
ref="scrollContainer"
:style="{
height: 'calc(100dvh - var(--toolbar-height) - 3rem)',
}"
class="overflow-y-auto nc-scrollbar-md mx-auto w-full"
>
<div
2 months ago
v-if="(props.type === 'github' ? isErrorOccurred.github : isErrorOccurred.cloud) && !feeds.length"
class="h-full flex justify-center items-center"
>
<FeedError :page="type" />
</div>
2 months ago
<div v-else-if="isLoading && !feeds.length" class="flex items-center justify-center h-full w-full">
<GeneralLoader size="xlarge" />
</div>
<div v-else class="mx-auto max-w-[540px] xl:max-w-[638px] justify-around justify-items-center">
2 months ago
<FeedChangelogItem v-for="(item, index) in feeds" :key="item.Id" :item="item" :index="index" />
</div>
2 months ago
</div>
</template>
<style scoped lang="scss"></style>