Skip to content

Commit

Permalink
fix ts issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cars10 committed Mar 30, 2024
1 parent 98d1030 commit efbd442
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/indices/IndicesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

<template #bottom="scope">
<table-bottom v-model="indicesStore.pagination.rowsPerPage"
:scope="scope"
:scope="scope as TableBottomScope"
:total="items.length"
:rows-per-page="rowsPerPage"
@rows-per-page-accepted="acceptRowsPerPage" />
Expand All @@ -78,6 +78,7 @@
<script setup lang="ts">
import FilterInput from '../shared/FilterInput.vue'
import TableBottom from '../shared/TableBottom.vue'
import type { TableBottomScope } from '../shared/TableBottom.vue'
import IndexBulk from './IndexBulk.vue'
import IndexRow from './IndexRow.vue'
import NewIndex from './NewIndex.vue'
Expand Down
3 changes: 2 additions & 1 deletion src/components/search/SearchResultsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

<template #bottom="scope">
<table-bottom v-model="searchStore.pagination.rowsPerPage"
:scope="scope"
:scope="scope as TableBottomScope"
:total="hits.length"
:rows-per-page="rowsPerPage"
@rows-per-page-accepted="acceptRowsPerPage" />
Expand Down Expand Up @@ -107,6 +107,7 @@
useSearchResultsTable
} from '../../composables/components/search/SearchResultsTable.ts'
import TableBottom from '../shared/TableBottom.vue'
import type { TableBottomScope } from '../shared/TableBottom.vue'
const props = defineProps<SearchResultsTableProps>()
const emit = defineEmits(['request', 'reload'])
Expand Down
6 changes: 5 additions & 1 deletion src/components/shared/TableBottom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,22 @@
import { computed, ref, watch } from 'vue'
import { useTranslation } from '../../composables/i18n.ts'
type TableBottomScope = {
export type TableBottomScope = {
pagesNumber: number
isFirstPage: boolean
isLastPage: boolean
firstPage: () => {}
lastPage: () => {}
nextPage: () => {}
prevPage: () => {}
inFullscreen: boolean
toggleFullscreen: () => {}
pagination: {
rowsPerPage: number
page: number
rowsNumber?: number
sortBy: string | null
descending: boolean
}
}
Expand Down

0 comments on commit efbd442

Please sign in to comment.