Skip to content

Conversation

J-Michalek
Copy link
Contributor

πŸ”— Linked issue

Resolves: #4424

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I've added the option to replace the entire item using the item-wrapper slot, this can be useful to display errors or to handle end branches of the tree.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

pkg-pr-new bot commented Jul 14, 2025

npm i https://pkg.pr.new/@nuxt/ui@4521

commit: f9c4acd

@freyjameetsmel
Copy link

Hey πŸ‘‹

This would be exactly what we need for our project. 🀩 We have a component that is based on the Tree component, but each element should be rendered as something other than a button. So the item-wrapper slot would be perfect.
Is there a possibility to get this in one of the next releases? We would realy appreciate it.

Thx, Mel

benjamincanac
benjamincanac approved these changes Aug 7, 2025
@benjamincanac benjamincanac changed the title feat(Tree): implement item-wrapper slot feat(Tree): add item-wrapper slot Aug 7, 2025
@benjamincanac benjamincanac merged commit 411d937 into nuxt:v3 Aug 7, 2025
6 checks passed
@benjilollebg
Copy link

benjilollebg commented Aug 26, 2025

Hey, I would like to use the item-wrapper to "wrap" the item in a droppable div, but keep the same base display. When i use the item-wrapper, it overrides everything in it instead of wrapping it (or I don't use it correctly). I would expect this to do the job :

<UTree v-if="folderItems.length" v-model="selectedFolderTreeItem" expanded-icon="i-lucide-folder" trailing-icon="" :items="folderItems" :ui="{ root: 'font-medium p-2', }" > <template #item-wrapper="{ item }"> <span @drop="(e) => onDropFolder(e, item.value!)" class="block w-full" draggable="true" @dragstart="(e) => onDragFolder(e, item.folder)" @dragover=" (event: DragEvent) => { event.preventDefault(); } " > <slot></slot> </span> </template> </UTree>

as it doesnt work as expected, can someone give me a hint on how to do it if its possible ?

@benjamincanac benjamincanac added the v3 #1289 label Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 #1289
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to not use button container for tree custom slot
4 participants