-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from lukashornych/feature-62-console-visualiser
#62: improvements and fixes for result visualiser
- Loading branch information
Showing
15 changed files
with
545 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<script setup lang="ts"> | ||
/** | ||
* Allows pagination in form of a "show more" button. | ||
*/ | ||
import { computed } from 'vue' | ||
const props = defineProps<{ | ||
items: any[], | ||
page: number, | ||
pageSize: number | ||
}>() | ||
const emit = defineEmits<{ | ||
(e: 'update:page', page: number): void | ||
}>() | ||
const lastPage = computed<number>(() => { | ||
return Math.ceil(props.items.length / props.pageSize) | ||
}) | ||
const pageOfItems = computed<any[]>(() => { | ||
return props.items.slice(0, props.page * props.pageSize) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<template v-for="(item, index) in pageOfItems" :key="index"> | ||
<slot name="item" :item="item" :index="index" /> | ||
</template> | ||
<VListItem v-if="lastPage > 1 && page < lastPage>"> | ||
Check failure on line 29 in src/components/base/VListItemLazyIterator.vue GitHub Actions / Build
|
||
<VBtn | ||
variant="outlined" | ||
@click="emit('update:page', page + 1)" | ||
> | ||
Show more | ||
</VBtn> | ||
</VListItem> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.