From ebba7cc73cf00b5803dbb49e7808e0fd0a6417e3 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Mon, 9 Dec 2019 10:20:49 +0300 Subject: [PATCH] Implemented panel menu --- src/components/panelmenu/PanelMenu.vue | 46 +++++++++++++++++ src/components/panelmenu/PanelMenuSub.vue | 62 +++++++++++++++++++++-- 2 files changed, 105 insertions(+), 3 deletions(-) diff --git a/src/components/panelmenu/PanelMenu.vue b/src/components/panelmenu/PanelMenu.vue index 23d07269d..8dc7483e7 100644 --- a/src/components/panelmenu/PanelMenu.vue +++ b/src/components/panelmenu/PanelMenu.vue @@ -9,6 +9,13 @@ {{item.label}} + +
+
+ +
+
+
@@ -31,7 +38,26 @@ export default { }, methods: { onItemClick(event, item) { + if (item.disabled) { + event.preventDefault(); + return; + } + if (!item.url) { + event.preventDefault(); + } + + if (item.command) { + item.command({ + originalEvent: event, + item: item + }); + } + + if (this.activeItem && this.activeItem === item) + this.activeItem = null; + else + this.activeItem = item; }, getPanelClass(item) { return ['p-panelmenu-panel', item.class, {'p-disabled': item.disabled}]; @@ -119,4 +145,24 @@ export default { display: block; text-decoration: none; } + +.p-panelmenu-content-wrapper-enter, +.p-panelmenu-content-wrapper-leave-to { + max-height: 0; +} + +.p-panelmenu-content-wrapper-enter-to, +.p-panelmenu-content-wrapper-leave { + max-height: 1000px; +} + +.p-panelmenu-content-wrapper-leave-active { + overflow: hidden; + transition: max-height 0.45s cubic-bezier(0, 1, 0, 1); +} + +.p-panelmenu-content-wrapper-enter-active { + overflow: hidden; + transition: max-height 1s ease-in-out; +} diff --git a/src/components/panelmenu/PanelMenuSub.vue b/src/components/panelmenu/PanelMenuSub.vue index 196850181..590bb5f47 100644 --- a/src/components/panelmenu/PanelMenuSub.vue +++ b/src/components/panelmenu/PanelMenuSub.vue @@ -1,15 +1,71 @@ \ No newline at end of file