diff --git a/packages/vuetify/src/components/VList/VList.tsx b/packages/vuetify/src/components/VList/VList.tsx index 8a449d244fb..7414c4b6429 100644 --- a/packages/vuetify/src/components/VList/VList.tsx +++ b/packages/vuetify/src/components/VList/VList.tsx @@ -120,7 +120,7 @@ export const makeVListProps = propsFactory({ ...makeElevationProps(), ...makeItemsProps(), ...makeRoundedProps(), - ...makeTagProps(), + ...makeTagProps({ tag: 'ul' }), ...makeThemeProps(), ...makeVariantProps({ variant: 'text' } as const), }, 'VList') @@ -288,6 +288,7 @@ export const VList = genericComponent = { @@ -26,12 +27,14 @@ export type VListChildrenSlots = { } export const makeVListChildrenProps = propsFactory({ + groupTag: [String, Object, Function] as PropType, items: Array as PropType, returnObject: Boolean, }, 'VListChildren') export const VListChildren = genericComponent( props: { + groupTag?: TagProps['tag'] items?: readonly T[] returnObject?: boolean }, @@ -64,10 +67,14 @@ export const VListChildren = genericComponent( title: slots.title ? (slotProps: any) => slots.title?.({ ...slotProps, item }) : undefined, } + const childrenTag = toRef(() => props.groupTag === 'ol' || props.groupTag === 'ul' ? 'li' : undefined) + const listGroupProps = VListGroup.filterProps(itemProps) return children ? ( ( }, default: () => ( ( ) : ( slots.item ? slots.item({ props: itemProps }) : ( } @@ -31,6 +35,10 @@ const VListGroupActivator = defineComponent({ }) export const makeVListGroupProps = propsFactory({ + groupTag: { + type: [String, Object, Function] as PropType, + default: 'div', + }, /* @deprecated */ activeColor: String, baseColor: String, @@ -114,9 +122,9 @@ export const VListGroup = genericComponent()({ )} -
+ { slots.default?.() } -
+
)) diff --git a/packages/vuetify/src/components/VTreeview/VTreeview.tsx b/packages/vuetify/src/components/VTreeview/VTreeview.tsx index d9d5c42f193..0ef70911f23 100644 --- a/packages/vuetify/src/components/VTreeview/VTreeview.tsx +++ b/packages/vuetify/src/components/VTreeview/VTreeview.tsx @@ -162,6 +162,7 @@ export const VTreeview = genericComponent(