Skip to content

Commit

Permalink
feat(#9): update menu (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher authored Nov 9, 2023
1 parent c692a00 commit 810b819
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default {
},
type: {
type: String,
default: 'collapsible'
default: undefined
}
}
}
Expand Down
12 changes: 7 additions & 5 deletions src/components/MenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,24 @@

<!-- Children - Collapsible -->
<div
v-if="isCollapsible && hasChildren"
v-if="!isFlyout && hasChildren"
class="ct-menu__sub-menu__wrapper"
:class="{
[`ct-menu__sub-menu__wrapper--level-${level + 1}`]: true,
}"
data-collapsible-panel
data-collapsible-trigger-no-icon
:data-collapsible-panel="isCollapsible"
:data-collapsible-trigger-no-icon="isCollapsible"
>
<CTMenu
class="ct-menu__sub-menu"
:level="level + 1"
:items="item.children"
:theme="theme"
/>
</div>

<!-- Children - Flyout -->
<CTFlyout v-if="isFlyout && hasChildren">
<CTFlyout v-else-if="isFlyout && hasChildren">
<template #open-button>
<CTButton
class="ct-mobile-navigation__open-subsection-trigger"
Expand Down Expand Up @@ -73,6 +74,7 @@
:items="item.children"
:level="level + 1"
type="flyout"
:theme="theme"
/>
</div>
</CTFlyout>
Expand All @@ -96,7 +98,7 @@ export default {
},
type: {
type: String,
default: 'collapsible'
default: undefined
}
},
Expand Down
5 changes: 4 additions & 1 deletion src/components/Navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
class="ct-navigation__menu"
:theme="theme"
:items="items"
:type="type"
/>
</slot>
</div>
Expand Down Expand Up @@ -40,7 +41,9 @@ export default {
},
computed: {
dropdownClass: ({ dropdown }) => `ct-navigation--${dropdown}`
dropdownClass: ({ dropdown }) => `ct-navigation--${dropdown}`,
type: ({ dropdown }) => dropdown === 'dropdown' ? 'collapsible' : undefined,
}
}
</script>

0 comments on commit 810b819

Please sign in to comment.