From d3315bda1120440fd4ae6c2650569ee38444f225 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 9 Jan 2022 22:57:27 +0900 Subject: [PATCH] wip: migrate paging components to composition api --- packages/client/src/components/timeline.vue | 293 ++++++++---------- .../client/src/components/ui/pagination.vue | 6 +- 2 files changed, 131 insertions(+), 168 deletions(-) diff --git a/packages/client/src/components/timeline.vue b/packages/client/src/components/timeline.vue index 53697671b2..a7af02c30b 100644 --- a/packages/client/src/components/timeline.vue +++ b/packages/client/src/components/timeline.vue @@ -1,184 +1,143 @@ - diff --git a/packages/client/src/components/ui/pagination.vue b/packages/client/src/components/ui/pagination.vue index 79744e528d..ab55b3c5bf 100644 --- a/packages/client/src/components/ui/pagination.vue +++ b/packages/client/src/components/ui/pagination.vue @@ -59,6 +59,10 @@ const props = withDefaults(defineProps<{ displayLimit: 30, }); +const emit = defineEmits<{ + (e: 'queue', count: number): void; +}>(); + const rootEl = ref(); const items = ref([]); const queue = ref([]); @@ -235,7 +239,7 @@ const append = (item) => { watch(props.pagination.params, init, { deep: true }); watch(queue, (a, b) => { if (a.length === 0 && b.length === 0) return; - this.$emit('queue', queue.value.length); + emit('queue', queue.value.length); }, { deep: true }); init();