docs: make <DataTable /> reactive (#229)
This commit is contained in:
parent
5e22ffc037
commit
15c42f9ee0
|
|
@ -173,8 +173,8 @@ const props = defineProps<{
|
|||
}>()
|
||||
|
||||
const table = useVueTable({
|
||||
data: props.data,
|
||||
columns: props.columns,
|
||||
get data() { return props.data },
|
||||
get columns() { return props.columns },
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
})
|
||||
</script>
|
||||
|
|
@ -389,8 +389,8 @@ import {
|
|||
} from "@tanstack/vue-table"
|
||||
|
||||
const table = useVueTable({
|
||||
data: props.data,
|
||||
columns: props.columns,
|
||||
get data() { return props.data },
|
||||
get columns() { return props.columns },
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
getPaginationRowModel: getPaginationRowModel(),
|
||||
})
|
||||
|
|
@ -408,8 +408,8 @@ We can add pagination controls to our table using the `<Button />` component and
|
|||
import { Button } from "@/components/ui/button"
|
||||
|
||||
const table = useVueTable({
|
||||
data: props.data,
|
||||
columns: props.columns,
|
||||
get data() { return props.data },
|
||||
get columns() { return props.columns },
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
getPaginationRowModel: getPaginationRowModel(),
|
||||
})
|
||||
|
|
@ -519,8 +519,8 @@ const props = defineProps<{
|
|||
const sorting = ref<SortingState>([])
|
||||
|
||||
const table = useVueTable({
|
||||
data: props.data,
|
||||
columns: props.columns,
|
||||
get data() { return props.data },
|
||||
get columns() { return props.columns },
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
getPaginationRowModel: getPaginationRowModel(),
|
||||
getSortedRowModel: getSortedRowModel(),
|
||||
|
|
@ -621,8 +621,8 @@ const sorting = ref<SortingState>([])
|
|||
const columnFilters = ref<ColumnFiltersState>([])
|
||||
|
||||
const table = useVueTable({
|
||||
data: props.data,
|
||||
columns: props.columns,
|
||||
get data() { return props.data },
|
||||
get columns() { return props.columns },
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
getPaginationRowModel: getPaginationRowModel(),
|
||||
getSortedRowModel: getSortedRowModel(),
|
||||
|
|
@ -715,8 +715,8 @@ const columnFilters = ref<ColumnFiltersState>([])
|
|||
const columnVisibility = ref<VisibilityState>({})
|
||||
|
||||
const table = useVueTable({
|
||||
data: props.data,
|
||||
columns: props.columns,
|
||||
get data() { return props.data },
|
||||
get columns() { return props.columns },
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
getPaginationRowModel: getPaginationRowModel(),
|
||||
getSortedRowModel: getSortedRowModel(),
|
||||
|
|
@ -842,8 +842,8 @@ const columnVisibility = ref<VisibilityState>({})
|
|||
const rowSelection = ref({})
|
||||
|
||||
const table = useVueTable({
|
||||
data: props.data,
|
||||
columns: props.columns,
|
||||
get data() { return props.data },
|
||||
get columns() { return props.columns },
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
getPaginationRowModel: getPaginationRowModel(),
|
||||
getSortedRowModel: getSortedRowModel(),
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ const columnVisibility = ref<VisibilityState>({})
|
|||
const rowSelection = ref({})
|
||||
|
||||
const table = useVueTable({
|
||||
data: props.data,
|
||||
columns: props.columns,
|
||||
get data() { return props.data },
|
||||
get columns() { return props.columns },
|
||||
state: {
|
||||
get sorting() { return sorting.value },
|
||||
get columnFilters() { return columnFilters.value },
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user