8000 fix(devtools): replace `UNavigationMenu` with `UTree` · romhml/compodium@8fbcdaa · GitHub
[go: up one dir, main page]

Skip to content

Commit 8fbcdaa

Browse files
committed
fix(devtools): replace UNavigationMenu with UTree
Replaces the NavigationMenu component on the ComponentCollection menu to fix an issue where the main component example is not selectable if the component has other examples.
1 parent 73c1bd0 commit 8fbcdaa

1 file changed

Lines changed: 22 additions & 5 deletions

File tree

‎packages/devtools/app/components/ComponentCollectionMenu.vue‎

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const treeItems = computed(() => {
1010
return props.collections?.map(col => ({
1111
label: col.name,
1212
icon: col.icon,
13-
defaultOpen: true,
13+
defaultExpanded: true,
1414
children: col.components?.map(comp => ({
1515
label: comp?.isExample ? comp.pascalName.replace(/Example$/, '') : comp.pascalName,
1616
active: modelValue.value?.pascalName === comp.pascalName,
@@ -30,9 +30,26 @@ const treeItems = computed(() => {
3030
</script>
3131

3232
<template>
33-
<UNavigationMenu
33+
<UTree
3434
:items="treeItems"
35-
orientation="vertical"
36-
class="px-1 bg-elevated/50"
37-
/>
35+
class="px-1"
36+
>
37+
<template
38+
#item-leading="{ item }"
39+
>
40+
<UIcon
41+
v-if="item.icon"
42+
:name="item.icon"
43+
/>
44+
<UIcon
45+
v-else-if="item.children?.length"
46+
name="lucide:chevron-right"
47+
class="transform transition-transform duration-200 group-data-expanded:rotate-90"
48+
/>
49+
<span v-else />
50+
</template>
51+
<template #item-trailing>
52+
<span />
53+
</template>
54+
</UTree>
3855
</template>

0 commit comments

Comments
 (0)
0