From f64c21c684feb69409d6d30e81d848017b0c47a5 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Thu, 18 Nov 2021 12:22:44 +0300 Subject: [PATCH] Fixed #449 - Dynamic labels for Menu components --- src/components/breadcrumb/BreadcrumbItem.vue | 7 +++++-- src/components/contextmenu/ContextMenuSub.vue | 11 +++++++---- src/components/megamenu/MegaMenu.vue | 17 ++++++++++------- src/components/menu/Menu.vue | 9 ++++++--- src/components/menu/Menuitem.vue | 7 +++++-- src/components/menubar/MenubarSub.vue | 11 +++++++---- src/components/panelmenu/PanelMenu.vue | 9 ++++++--- src/components/panelmenu/PanelMenuSub.vue | 11 +++++++---- src/components/steps/Steps.vue | 7 +++++-- src/components/tabmenu/TabMenu.vue | 9 ++++++--- src/components/tieredmenu/TieredMenuSub.vue | 11 +++++++---- src/components/tree/TreeNode.vue | 5 ++++- src/views/menumodel/MenuModel.vue | 4 ++-- 13 files changed, 77 insertions(+), 41 deletions(-) diff --git a/src/components/breadcrumb/BreadcrumbItem.vue b/src/components/breadcrumb/BreadcrumbItem.vue index 39134cffd..2083a30a9 100755 --- a/src/components/breadcrumb/BreadcrumbItem.vue +++ b/src/components/breadcrumb/BreadcrumbItem.vue @@ -4,12 +4,12 @@ - {{item.label}} + {{label()}} - {{item.label}} + {{label()}} @@ -51,6 +51,9 @@ export default { }, disabled(item) { return (typeof item.disabled === 'function' ? item.disabled() : item.disabled); + }, + label() { + return (typeof this.item.label === 'function' ? this.item.label() : this.item.label); } }, computed: { diff --git a/src/components/contextmenu/ContextMenuSub.vue b/src/components/contextmenu/ContextMenuSub.vue index 5e264faa7..ea3fb303d 100755 --- a/src/components/contextmenu/ContextMenuSub.vue +++ b/src/components/contextmenu/ContextMenuSub.vue @@ -1,25 +1,25 @@