feat: following (#22)

This commit is contained in:
patak 2022-11-21 23:59:51 +01:00 committed by GitHub
parent f97920d9d2
commit 9aa7243d43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 5 deletions

View file

@ -1,4 +1,5 @@
<script setup lang="ts">
import type { Ref } from 'vue'
import type { Paginator } from 'masto'
const { paginator, keyProp = 'id' } = defineProps<{
@ -6,7 +7,13 @@ const { paginator, keyProp = 'id' } = defineProps<{
keyProp?: string
}>()
const { items, state, endAnchor, error } = usePaginator(paginator)
const emit = defineEmits(['items'])
const { items, newItems, state, endAnchor, error } = usePaginator(paginator)
watch(newItems, () => {
emit('items', newItems.value)
})
</script>
<template>