vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.64k stars 6.95k forks source link

[Feature Request] Slot for group in VTreeview #20292

Open jelle-eastground opened 1 month ago

jelle-eastground commented 1 month ago

Problem to solve

In VTreeview there seems no way to customize a group using the slots, because only a slot for an item is available.

Proposed solution

It would be great if a group slot with props is exposed in VTreeview, to be able to do the following:

<template>
  <v-treeview>
    <!-- missing: -->
    <template v-slot:group="{ props }">
      <v-treeview-group v-bind="props"/>
    </template>

    <!-- already available: -->
    <template v-slot:item="{ props }">
      <v-treeview-item v-bind="props"/>
    </template>
  </v-treeview>
</template>

Could this group slot be added? I think this issue is related.

yuwu9145 commented 1 month ago

What's your use case?

jelle-eastground commented 1 month ago

What's your use case?

I want to assign a draggable handler to both the leaf items and the group items. For a leaf item I already use this:

<v-treeview-item v-bind="props" :draggable=props.draggable @dragstart="onDragStart($event, props)"/>

I would like to be able to do the same for a group item in the tree.