fix(Table): proxy props without useForwardProps

https://github.com/nuxt/ui/issues/3255#issuecomment-2640503829
This commit is contained in:
Benjamin Canac
2025-02-15 18:43:33 +01:00
parent fa92053116
commit f0553ebb49

View File

@@ -161,7 +161,7 @@ export type TableSlots<T> = {
<script setup lang="ts" generic="T extends TableData">
import { computed } from 'vue'
import { Primitive, useForwardProps } from 'reka-ui'
import { Primitive } from 'reka-ui'
import { upperFirst } from 'scule'
import { FlexRender, getCoreRowModel, getFilteredRowModel, getSortedRowModel, getExpandedRowModel, useVueTable } from '@tanstack/vue-table'
import { reactiveOmit } from '@vueuse/core'
@@ -196,10 +196,8 @@ const groupingState = defineModel<GroupingState>('grouping', { default: [] })
const expandedState = defineModel<ExpandedState>('expanded', { default: {} })
const paginationState = defineModel<PaginationState>('pagination', { default: {} })
const tableProps = useForwardProps(reactiveOmit(props, 'as', 'data', 'columns', 'caption', 'sticky', 'loading', 'loadingColor', 'loadingAnimation', 'class', 'ui'))
const tableApi = useVueTable({
...tableProps,
...reactiveOmit(props, 'as', 'data', 'columns', 'caption', 'sticky', 'loading', 'loadingColor', 'loadingAnimation', 'class', 'ui'),
data,
columns: columns.value,
getCoreRowModel: getCoreRowModel(),