wip: refactor(client): migrate paging components to composition api
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
|
||||
<template #default="{ items }">
|
||||
<XList v-slot="{ item }" :items="items" :direction="'down'" :no-gap="false" :ad="false">
|
||||
<XNote :key="item.id" :note="item.note" :class="$style.note" @update:note="noteUpdated(item, $event)"/>
|
||||
<XNote :key="item.id" :note="item.note" :class="$style.note"/>
|
||||
</XList>
|
||||
</template>
|
||||
</MkPagination>
|
||||
@ -32,13 +32,6 @@ const pagination = {
|
||||
|
||||
const pagingComponent = ref<InstanceType<typeof MkPagination>>();
|
||||
|
||||
const noteUpdated = (item, note) => {
|
||||
pagingComponent.value?.updateItem(item.id, old => ({
|
||||
...old,
|
||||
note: note,
|
||||
}));
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
[symbols.PAGE_INFO]: {
|
||||
title: i18n.locale.favorites,
|
||||
@ -53,4 +46,4 @@ defineExpose({
|
||||
background: var(--panel);
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<MkReactionIcon class="reaction" :reaction="item.type" :custom-emojis="item.note.emojis" :no-style="true"/>
|
||||
<MkTime :time="item.createdAt" class="createdAt"/>
|
||||
</div>
|
||||
<MkNote :key="item.id" :note="item.note" @update:note="updated(note, $event)"/>
|
||||
<MkNote :key="item.id" :note="item.note"/>
|
||||
</div>
|
||||
</MkPagination>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user