Skip to content

Commit

Permalink
fix(VListGroup): support return-object
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwu9145 committed Oct 20, 2024
1 parent b0d1215 commit 4d40591
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/vuetify/src/components/VList/VListChildren.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ export const VListChildren = genericComponent<new <T extends InternalListItem>(

return children ? (
<VListGroup
value={ itemProps?.value }
{ ...listGroupProps }
value={ props.returnObject ? item : itemProps?.value }
id={ itemProps?.value }
>
{{
activator: ({ props: activatorProps }) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/vuetify/src/components/VList/VListGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const makeVListGroupProps = propsFactory({
type: IconValue,
default: '$expand',
},
id: String,
prependIcon: IconValue,
appendIcon: IconValue,
fluid: Boolean,
Expand All @@ -61,7 +62,7 @@ export const VListGroup = genericComponent<VListGroupSlots>()({

setup (props, { slots }) {
const { isOpen, open, id: _id } = useNestedItem(toRef(props, 'value'), true)
const id = computed(() => `v-list-group--id-${String(_id.value)}`)
const id = computed(() => `v-list-group--id-${String(props.value ?? _id.value)}`)
const list = useList()
const { isBooted } = useSsrBoot()

Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/labs/VTreeview/VTreeviewChildren.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const VTreeviewChildren = genericComponent<new <T extends InternalListIte
return children ? (
<VTreeviewGroup
{ ...treeviewGroupProps }
value={ treeviewGroupProps?.value }
value={ props.returnObject ? item.raw : treeviewGroupProps?.value }
>
{{
activator: ({ props: activatorProps }) => {
Expand Down

0 comments on commit 4d40591

Please sign in to comment.