-
-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(VDataTable,VDataIterator)!: add item-id
and fix check/uncheck all entries performance
#20441
base: master
Are you sure you want to change the base?
Conversation
…all entries performance
@@ -70,6 +70,8 @@ export function getObjectValueByPath (obj: any, path?: string | null, fallback?: | |||
return getNestedValue(obj, path.split('.'), fallback) | |||
} | |||
|
|||
export type SelectItemId = string | undefined | ((item: any) => string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add number
to the function: string | number
, we should review the type returned here, we also need the item-id
prop, in any case, should it should be a primivite?.
We can keep string
, the user should add it using proper conversion: id: number | string
packages/vuetify/src/components/VDataTable/composables/select.ts
Outdated
Show resolved
Hide resolved
Hi ,What time this draft can be merged and release @userquin userquin |
Description
This PR adds a new
item-id
prop toVDataTable
andVDataIterator
usingid
when not configured (default).I need to add the new
item-id
to the api and check theselectStrategy
, looks like can be a custom object, checkselectStrategy
computed (L127) inpackages/vuetify/src/components/VDataTable/composables/select.ts
module in this PR (added TODO).Pending tasks:
VDataIterator
api docs includesitem-key
but missing in the props, should be renamed toitem-id
VDataTable
andVDataIterator
examples in docsSelectItemId
return type, maybe we can useany
item-id
We should review also the
item-value
and change it toundefined
, in the api docs usingid
.The performance issue in #19447 is the
isSelected
computed, with this PR just a map lookup using the newitem-id
.fixes #19447
Markup:
https://streamable.com/98scf9
10K rows VDataTable