wip: refactor(client): migrate paging components to composition api

This commit is contained in:
syuilo
2022-01-14 10:25:51 +09:00
parent 27778f839a
commit 28193f12ca
14 changed files with 791 additions and 1596 deletions

View File

@ -10,7 +10,7 @@
<template #default="{ items: notes }">
<div class="giivymft" :class="{ noGap }">
<XList ref="notes" v-slot="{ item: note }" :items="notes" :direction="pagination.reversed ? 'up' : 'down'" :reversed="pagination.reversed" :no-gap="noGap" :ad="true" class="notes">
<XNote :key="note._featuredId_ || note._prId_ || note.id" class="qtqtichx" :note="note" @update:note="updated(note, $event)"/>
<XNote :key="note._featuredId_ || note._prId_ || note.id" class="qtqtichx" :note="note"/>
</XList>
</div>
</template>
@ -31,10 +31,6 @@ const props = defineProps<{
const pagingComponent = ref<InstanceType<typeof MkPagination>>();
const updated = (oldValue, newValue) => {
pagingComponent.value?.updateItem(oldValue.id, () => newValue);
};
defineExpose({
prepend: (note) => {
pagingComponent.value?.prepend(note);