Skip to content

Commit

Permalink
feat(table): resure generics
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaubree committed Aug 17, 2023
1 parent 9dc36b4 commit 92f0f71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/table/UTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { DeepPartial } from '~/types'
export interface Sort { column?: string; direction?: 'asc' | 'desc' }
const props = withDefaults(defineProps<{
sortBy?: string | ((a: unknown, b: unknown) => void)
sortBy?: string | ((a: T, b: T) => void)
rows?: T[]
columns?: { key: string; sortable?: boolean; class?: string; [key: string]: any }[]
columnAttribute?: string
Expand Down Expand Up @@ -47,7 +47,7 @@ const rows = computed(() => {
return orderBy(props.rows, column, direction)
})
function compare(a, z) {
function compare(a: T, z: T) {
if (typeof props.sortBy === 'string') {
const property = props.sortBy
return a?.[property] === z?.[property]
Expand Down

0 comments on commit 92f0f71

Please # to comment.