Skip to content

Commit

Permalink
feat(table): improve watching sortedRows for reactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki committed Nov 10, 2022
1 parent 3ad65fb commit 8b700ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/anu-vue/src/components/table/ATable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export const ATable = defineComponent({
)

// 馃憠 Paginated Rows
const paginatedRows = computed(() => sortedRows.value)
const paginatedRows = ref<any[]>([])

// TODO: Check passing toRef(props, 'pageSize') to useOffsetPagination and use returned `currentPageSize` for reactive pgeSize prop
const currentPageSize = ref(props.pageSize)
Expand Down Expand Up @@ -273,7 +273,7 @@ export const ATable = defineComponent({
paginateRows({ currentPage: currentPage.value, currentPageSize: currentPageSize.value })
}

watch([_search, sortedCols], recalculateCurrentPageData, { deep: true, immediate: true })
watch([_search, sortedCols, sortedRows], recalculateCurrentPageData, { deep: true, immediate: true })

// 馃憠 rowsToRender
const rowsToRender = computed(() => isSST.value ? _serverRows.value : paginatedRows.value)
Expand Down

0 comments on commit 8b700ee

Please sign in to comment.