mirror of https://github.com/nocodb/nocodb
DarkPhoenix2704
2 months ago
11 changed files with 200 additions and 96 deletions
Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 410 B |
@ -0,0 +1,36 @@ |
|||||||
|
<script setup lang="ts"> |
||||||
|
import Tweet from 'vue-tweet' |
||||||
|
|
||||||
|
const { twitterFeed, loadFeed } = useProductFeed() |
||||||
|
|
||||||
|
const scrollContainer = ref<HTMLElement>() |
||||||
|
|
||||||
|
const { isLoading } = useInfiniteScroll( |
||||||
|
scrollContainer, |
||||||
|
async () => { |
||||||
|
if (isLoading.value) return |
||||||
|
const data = await loadFeed({ |
||||||
|
type: 'twitter', |
||||||
|
loadMore: true, |
||||||
|
}) |
||||||
|
twitterFeed.value = [...twitterFeed.value, ...data] |
||||||
|
}, |
||||||
|
{ distance: 1 }, |
||||||
|
) |
||||||
|
</script> |
||||||
|
|
||||||
|
<template> |
||||||
|
<div |
||||||
|
ref="scrollContainer" |
||||||
|
:style="{ |
||||||
|
height: 'calc(100dvh - var(--toolbar-height) - 3.25rem)', |
||||||
|
}" |
||||||
|
class="overflow-y-auto nc-scrollbar-md w-full" |
||||||
|
> |
||||||
|
<div class="flex items-center flex-col"> |
||||||
|
<Tweet v-for="feed in twitterFeed" :key="feed.Id" :tweet-url="feed.Url" /> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<style scoped lang="scss"></style> |
Loading…
Reference in new issue