wip: migrate paging components to composition api

This commit is contained in:
syuilo
2022-01-09 22:57:27 +09:00
parent 586c11251a
commit d3315bda11
2 changed files with 131 additions and 168 deletions

View File

@ -59,6 +59,10 @@ const props = withDefaults(defineProps<{
displayLimit: 30,
});
const emit = defineEmits<{
(e: 'queue', count: number): void;
}>();
const rootEl = ref<HTMLElement>();
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();