Skip to content

Commit

Permalink
fix(table): mark onClick as required in TableAction (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Oct 3, 2023
1 parent fffe693 commit b5d4131
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/components/STableHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const stats = computed(() => {
// deprecated `reset` prop in favor of `actions`, remove this in next major version
const resetAction = computed(() => {
return props.reset
? [{ label: 'Reset filters', onClick: props.onReset, type: 'info' }]
? [{ label: 'Reset filters', onClick: props.onReset!, type: 'info' }] // onReset is required when reset is true
: []
})
</script>
Expand Down
2 changes: 1 addition & 1 deletion lib/composables/Table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export interface TableAction {
mode?: 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
label: string
labelMode?: 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
onClick?(): void
onClick(): void
}

export function useTable<
Expand Down

0 comments on commit b5d4131

Please sign in to comment.