fix(select-tree): adjust tree node indentation and alignment logic

- Add level prop to track node hierarchy
- Fix indentation calculation for leaves and nodes
- Simplify alignment logic based on node level
This commit is contained in:
Khafid Prayoga
2025-09-16 15:14:37 +07:00
parent b106b1d23e
commit c5ec8ccd32
4 changed files with 18 additions and 12 deletions

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ function handleSelect(value: string) {
<CommandItem
:value="item.value"
class="flex items-center justify-between p-2 w-full text-sm font-normal hover:text-primary cursor-pointer rounded-md"
:class="{ 'pl-12': shouldAlign }"
:class="{ 'pl-8': shouldAlign }"
@select="() => handleSelect(item.value)"
>
<span class="text-sm font-normal">{{ item.label }}</span>