mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-29 19:30:37 +01:00
fix(Table): proxy props without useForwardProps
https://github.com/nuxt/ui/issues/3255#issuecomment-2640503829
This commit is contained in:
@@ -161,7 +161,7 @@ export type TableSlots<T> = {
|
|||||||
|
|
||||||
<script setup lang="ts" generic="T extends TableData">
|
<script setup lang="ts" generic="T extends TableData">
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { Primitive, useForwardProps } from 'reka-ui'
|
import { Primitive } from 'reka-ui'
|
||||||
import { upperFirst } from 'scule'
|
import { upperFirst } from 'scule'
|
||||||
import { FlexRender, getCoreRowModel, getFilteredRowModel, getSortedRowModel, getExpandedRowModel, useVueTable } from '@tanstack/vue-table'
|
import { FlexRender, getCoreRowModel, getFilteredRowModel, getSortedRowModel, getExpandedRowModel, useVueTable } from '@tanstack/vue-table'
|
||||||
import { reactiveOmit } from '@vueuse/core'
|
import { reactiveOmit } from '@vueuse/core'
|
||||||
@@ -196,10 +196,8 @@ const groupingState = defineModel<GroupingState>('grouping', { default: [] })
|
|||||||
const expandedState = defineModel<ExpandedState>('expanded', { default: {} })
|
const expandedState = defineModel<ExpandedState>('expanded', { default: {} })
|
||||||
const paginationState = defineModel<PaginationState>('pagination', { 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({
|
const tableApi = useVueTable({
|
||||||
...tableProps,
|
...reactiveOmit(props, 'as', 'data', 'columns', 'caption', 'sticky', 'loading', 'loadingColor', 'loadingAnimation', 'class', 'ui'),
|
||||||
data,
|
data,
|
||||||
columns: columns.value,
|
columns: columns.value,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
|||||||
Reference in New Issue
Block a user