Treeview - any way to fill expand-icon space for items without children, to align text? #20561
-
I'm trying to use Treeview for nav, and finally figured out that I needed the children property to be falsy to not have the expand-icon present on all nodes; but now I'm trying to figure out how to keep all the text horizontally aligned to the text whether it has children or not. Seems like the best way would be to be able to pass an icon (or empty string) for use when the expand/collapse icons aren't used, but looking at the code, that would require some changes. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Found most of a solution in the treeview example for load-children. <v-treeview>
<template #prepend="{item}">
<v-list-item-action
v-if="!item.children"
>
<div style="width:28px" />
</v-list-item-action>
</template>
</v-treeview> |
Beta Was this translation helpful? Give feedback.
Found most of a solution in the treeview example for load-children.
You have to add to the prepend slot, and insert an list-item-action element with an internal width that matches the buttons used in expand/colapse, so that the correct spacer widths get applied.