Skip to content

Commit

Permalink
chore(VTreeviewChildren): code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed May 21, 2024
1 parent 6dc6838 commit 827a74e
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions packages/vuetify/src/labs/VTreeview/VTreeviewChildren.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,19 @@ export const VTreeviewChildren = genericComponent<new <T extends InternalListIte
const slotsWithItem = {
prepend: slotProps => (
<>
{
props.selectable && (!children || (children && props.selectStrategy !== 'single-leaf' && props.selectStrategy !== 'leaf'))
? (
<div>
<VCheckboxBtn
key={ item.value }
tabindex="-1"
modelValue={ slotProps.isSelected }
loading={ loading }
indeterminate={ slotProps.isIndeterminate }
onClick={ withModifiers(() => selectItem(slotProps.select, slotProps.isSelected), ['stop']) }
/>
</div>
)
: undefined
}
{ props.selectable && (!children || (children && !['leaf', 'single-leaf'].includes(props.selectStrategy as string))) && (
<div>
<VCheckboxBtn
key={ item.value }
tabindex="-1"
modelValue={ slotProps.isSelected }
loading={ loading }
indeterminate={ slotProps.isIndeterminate }
onClick={ withModifiers(() => selectItem(slotProps.select, slotProps.isSelected), ['stop']) }
/>
</div>
)}

{ slots.prepend?.({ ...slotProps, item }) }
</>
),
Expand Down

0 comments on commit 827a74e

Please sign in to comment.