Skip to content

Commit

Permalink
fix: default props
Browse files Browse the repository at this point in the history
  • Loading branch information
francisashley committed Jan 3, 2025
1 parent c0636c5 commit 8c74857
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-screener",
"version": "0.15.10",
"version": "0.15.11",
"type": "module",
"description": "Easily search and filter data in Vue3.",
"author": "Francis Ashley",
Expand Down
16 changes: 14 additions & 2 deletions src/components/VueScreener.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,20 @@ const props = defineProps<{
title?: string
}>()
const internalScreener = computed(() => props.screener ?? useVueScreener(props.data ?? []))
const internalScreener = computed(
() =>
props.screener ??
useVueScreener(props.data ?? [], {
contentHeight: props.contentHeight,
defaultCurrentPage: props.defaultCurrentPage,
defaultRowsPerPage: props.defaultRowsPerPage,
defaultSortField: props.defaultSortField,
defaultSortDirection: props.defaultSortDirection,
columns: props.columns,
disableSearchHighlight: props.disableSearchHighlight,
loading: props.loading,
}),
)
watch(() => props.data, (data: any) => props.data && internalScreener.value.actions.setData(data), { immediate: true }) // eslint-disable-line
watch(
Expand All @@ -60,7 +73,6 @@ watch(
loading: props.loading,
}),
(options) => internalScreener.value.actions.setOptions(options),
{ immediate: true },
)
const screenerRef = ref()
Expand Down

0 comments on commit 8c74857

Please sign in to comment.