From 2b7ff3edf6620d7ed4a491d89f0e616b5916984b Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Fri, 24 Jan 2025 14:07:29 +0100 Subject: [PATCH] fix(NavigationMenu): handle children recursively in vertical orientation Resolves #3128 --- src/runtime/components/NavigationMenu.vue | 120 +++++---- .../NavigationMenu-vue.spec.ts.snap | 240 +++++++++--------- .../__snapshots__/NavigationMenu.spec.ts.snap | 240 +++++++++--------- 3 files changed, 297 insertions(+), 303 deletions(-) diff --git a/src/runtime/components/NavigationMenu.vue b/src/runtime/components/NavigationMenu.vue index 6f5f71a840..93cd89b8fd 100644 --- a/src/runtime/components/NavigationMenu.vue +++ b/src/runtime/components/NavigationMenu.vue @@ -175,7 +175,8 @@ const rootProps = useForwardPropsEmits(computed(() => ({ const contentProps = toRef(() => props.content) -const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate<{ item: NavigationMenuItem, active?: boolean, index: number }>() +const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate<{ item: NavigationMenuItem, index: number, active?: boolean }>() +const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate<{ item: NavigationMenuItem, index: number }>() const ui = computed(() => navigationMenu({ orientation: props.orientation, @@ -190,7 +191,7 @@ const lists = computed(() => props.items?.length ? (Array.isArray(props.items[0]